Reputation: 51
I apologize if this is stupid question but I just started trying to incorporate the FB SDK into my app today.
I followed the instructions online and got to the point where they suggested testing the app. The FB app opened as expected and asked permission as expected. However when I accepted the FB app stayed open instead of going back to my app.
I think it may have to do with the access token keys. I found online how to get this key, but should I enter it in the code shown below? What about the expiration date key? Or are these generated dynamically?
facebook = [[Facebook alloc] initWithAppId:@"##########" andDelegate:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
Thanks!
if (![facebook isSessionValid]) {
[facebook authorize:nil];
}
Upvotes: 0
Views: 532
Reputation: 2975
did you add the custom URL scheme to your app plist?
you need to add fb[FB_APP_ID] as a custom URL scheme
it's in their instructions
Upvotes: 3