Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FBSDKLog: Cannot use the Facebook app or Safari to authorize, fb**** is not registered as a URL Scheme

I want to have the Facebook app native dialog login (https://developers.facebook.com/docs/technical-guides/iossdk/login/#fbnative).

In the console, I get the following message when clicking on the FBLoginView:

FBSDKLog: Cannot use the Facebook app or Safari to authorize, fb**** is not registered as a URL Scheme

Yet I did exactly as here: Failing to open active session after updating Facebook SDK to 3.5

like image 502
Benjamin Toueg Avatar asked Jun 16 '13 09:06

Benjamin Toueg


3 Answers

In myapp-Info.plist, I renamed URL Schemes key to CFBundleURLSchemes:

Before:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>URL Schemes</key>
        <array>
            <string>fb***</string>
        </array>
    </dict>
</array>

After:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb***</string>
        </array>
    </dict>
</array>

The difference is not visible in XCode because CFBundleURLSchemes is aliased with URL Schemes.

As a consequence, you have to edit myapp-Info.plist manually.

like image 170
Benjamin Toueg Avatar answered Nov 16 '22 02:11

Benjamin Toueg


The problem is in the plist file as it needs different settings then it was published in official Facebook video and articles for Facebook SDK 3.5.x.

If you'd like to use 2 or more apps with the same Facebook AppID - which is useful as all the activity, posts will cumulate under the same Facebook appearance for all version like premium or lite - but in this case you have to solve somehow that Facebook calls back (URL scheme) the correct app from where the user came from and the user could continue to use our app when finished with the Facebook activity, like post etc.

So we have to use URL types and URL Schemes in the Xcode and in the Facebook Developer settings as you can see on the illustrations below:

UPDATE 2015

I have updated the screenshots to reflect the new Facebook and Xcode settings:

Xcode 6

As you can see you have to use the FacebookAppID with the attached URL Scheme Suffix and the same FacebookDisplayName BUT you have to use the "fb" prefix in the URL types-->URL Schemes line and use the FacebookDisplayName in the Identifier line, see below. This will ensure that Facebook will call back the correct app (lite or premium in this example) but all the post etc will go to the same Facebook app.

enter image description here

Facebook

iPhone Store ID is for the premium version as we'd like to route the user to the paid version!

enter image description here

like image 38
BootMaker Avatar answered Nov 16 '22 00:11

BootMaker


In my app, the error was caused because the case of the property keys was incorrect.

They should be:

URL types (lowercase T)

URL Schemes (uppercase S)

like image 11
Philip Callender Avatar answered Nov 16 '22 01:11

Philip Callender



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!