Josh Mularella
Josh Mularella

Reputation: 51

Won't return to my app after logging into FB app

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

Answers (1)

Or Arbel
Or Arbel

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

Related Questions