I just updated my app with the new Facebook 3.0 SDK for iOS. Prior to this I was using the SDK that utilized FBSessionDelegate and FBRequestDelegate. In that SDK, we had to place this code in the applicationDidFinishLaunching:
facebook = [[Facebook alloc] initWithAppId:FB_APP_ID andDelegate:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
However now with the new 3.0 SDK, I'm told that all we have to do is import the framework, and resource bundles, then "add id named FacebookAppID to the bundle *.plist" So I've done this, but when I call any code with FBSession in it, I'm getting 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'
What could I be doing wrong?
@Kwame I faced the same problem , you session object is missing the App id . For this you can add an key in the info.plist named FacebookAppID and set the appropriate value with the app id provided to your ios app by facebook. or if in case you have already done this you can set the app id programmatically by setting the appropriate values in the - (id)initWithAppID:(NSString*)appID
permissions:(NSArray*)permissions
urlSchemeSuffix:(NSString*)urlSchemeSuffix
tokenCacheStrategy:(FBSessionTokenCachingStrategy*)tokenCachingStrategy;
method . Also please cross check the value of app id in info.plist. Hope this helps.