Reputation: 915
When I open a FBSession (FB SDK 3.0), I get this error:
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 know I can add a value for FacebookAppID in the .plist, but what method should I use to init the FBSession with an AppId? I have tried using [FBSession setDefaultAppID] but that doesn't seem to do it.
Upvotes: 4
Views: 8230
Reputation: 5296
For me this issue appeared because my project for some odd reason (probably trigger happy with my copy and pasting from previous projects) had 2 plist files! So this information was not present on the plist being read for the FacebookAppID. I deleted the plist I didn't want then went back to my app's General settings and selected the plist I wanted in the 'Identity' section. Boom! Fixed
Upvotes: 2
Reputation: 17624
This seems to work for me:
[FBSettings setDefaultAppID: @"123456789"];
Upvotes: 11
Reputation: 545
The new version of SDK doesn't accept
- (id)initWithAppId:(NSString *)app_id
andDelegate:(id<FBSessionDelegate>)delegate;
so Create a FacebookAppID in the info.plist file and give the app id as string input.
Upvotes: 9
Reputation: 7348
Generally you have to call initWithAppId: from the Facebook SDK.
- (id)initWithAppId:(NSString *)app_id
andDelegate:(id<FBSessionDelegate>)delegate;
See here: http://developers.facebook.com/docs/reference/iossdk/authentication/
Upvotes: 3