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


Solution 1:

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.

Solution 2:

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

Solution 3:

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)

Solution 4:

Found the solution for us:

We had two URL schemes defined. One for our app "ourapp://" and one for facebook "fb123456789".

As it turns out, the facebook URL has to be number one.

Solution 5:

I fixed this issue by removing the space i had between fb and my app ID in the info.plist