FB SDK 3.5 在登入之後一定要做 [FBSession setActiveSession:appDelegate.session];
因為SDK中很多method都會直接呼叫activeSession
[appDelegate.session openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if (!error) {
if ([appDelegate.session.permissions indexOfObject:@"publish_actions"] == NSNotFound) {
[appDelegate.session requestNewPublishPermissions:@[@"publish_actions",@"photo_upload"]
defaultAudience:FBSessionDefaultAudienceFriends
completionHandler:^(FBSession *session,
NSError *error) {
// Handle new permissions callback
appDelegate.session = session;
[FBSession setActiveSession:appDelegate.session];
}];
[self updateView];//為何logout的時候也會跑一次這裡!!??
}
}
}];
沒有留言:
張貼留言