2
votes

When trying to integrate the Facebook iOS SDK I encountered this error:

Terminating app due to uncaught exception 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'`

However, I did put FacebookAppID and a FB-specific URL scheme into Info.plist:

<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb35903424086XXXX</string>
        </array>
    </dict>
</array>
<key>FacebookAppID</key>
<string>35903424086XXXX</string>

Can anyone help?

1
could you edit your question to show what the FB-specific lines in your info.plist look like?Michael Dautermann

1 Answers

5
votes

Since Facebook app IDs are commonly all numbers, my guess is that you set the Info.plist entry for FacebookAppID to be a numeric type and not a string type. Change the row to a String and that should fix it. If you already have it as a String, please post the full Info.plist and I'll take a look at it.

Here are the relevant entries from an app that has working integration:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string></string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb1655585934xxxxx</string>
        </array>
    </dict>
</array>
<key>FacebookAppID</key>
<string>1655585934xxxxx</string>

It looks like the only difference is CFBundleURLName, can you try adding that?