开发者

Getting infinite FB session key from an iPhone application

I have an iPhone application which uses FBConnect to log the user in and also get some extended permissions. Now I need an infinite FB session key to post some info on the user's wall and I am trying to get the offline_access extended permission which seems to be not working.

FBPermissionDialog is not even showing that offline_access permission on the page which is a bit worrying. I tried this http://kokx85.blogspot.com/2010/05/iphone-extend-multiple-permission-from.html with no luck开发者_开发技巧 as the session key I'm getting back from the FBSession object when used in my PHP application shows "Session key invalid or no longer valid"

You can find the OBJ-C code below.

- (void)session:(FBSession*)session didLogin:(FBUID)user_id {
    self.usersession = session;
    NSLog(@"User with id %lld logged in.", user_id);

    if( !resume_session ){
        FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
        dialog.delegate = self;
        dialog.permission = @"offline_access,email,user_birthday"; 
        [dialog show];
    }
    else{

        [self getFacebookName];
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜