Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK - FBSession: No AppID provided

I want to integrate with Facebook login SDK in my iOS project. The problem is I got this error message during launching the app.

2015-01-08 18:33:06.591 XXXXX[24994:2533100] *** 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'

I already include this line into my info.plist but it is still not working.

info.list

<key>FacebookAppID</key>
    <string>&lt;1025024xxxxxxxx&gt;</string>
    <key>FacebookDisplayName</key>
    <string>XXXXXX</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb&lt;1025024xxxxxxxx&gt;</string>
            </array>
        </dict>
    </array>

I suspect it has not detected my Facebook ID. I'm using Xcode6.1.

like image 478
Nurdin Avatar asked Jan 08 '15 10:01

Nurdin


2 Answers

There is two info.plist file in your project with same name. one folder for YourProjectTests in which info.plist file and other YourProject is also info.plist file.

Two plist file :

enter image description here

You have to set your FacebookAppID in YourProject info.plist file, but not set YourProjectTests info.plist

This error is occurs because of YourProjectTests in which info.plist file setting FacebookAppID

Add Your FacebookAppID inabove info.plist file as above image.

Otherwise set also FacebookAppID as below.

enter image description here

like image 70
Kirit Modi Avatar answered Sep 20 '22 07:09

Kirit Modi


if you have already added App ID in info.plist and getting crash then make sure you have added this single line code in AppDelegate Class didFinishLaunchingOption

//Facebook setup
    ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
like image 30
Rohit Nishad Avatar answered Sep 19 '22 07:09

Rohit Nishad