2

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?

jszumski
  • 7,430
  • 11
  • 40
  • 53
user2274736
  • 75
  • 1
  • 5

1 Answers1

5

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?

jszumski
  • 7,430
  • 11
  • 40
  • 53
  • Sounds about right, this is something to watch out for when working with Facebook data. Often is the case developers treat user IDs as int too, but even then it can bite you because the numbers are very long (they have their own structure, it's not incremental). Check out here: http://stackoverflow.com/a/6959796/662605 – Daniel Apr 12 '13 at 15:03