Facebook的登錄清單:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [FBSession.activeSession handleOpenURL:url];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// We need to properly handle activation of the application with regards to SSO
// (e.g., returning from iOS 6.0 authorization dialog or from fast app switching).
[FBSession.activeSession handleDidBecomeActive];
}
- (void)applicationWillTerminate:(UIApplication *)application {
// if the app is going away, we close the session object; this is a good idea because
// things may be hanging off the session, that need releasing (completion block, etc.) and
// other components in the app may be awaiting close notification in order to do cleanup
[FBSession.activeSession close];
}
在我sessionStateChanged:我這樣做
switch (state) {
case FBSessionStateOpen:
[[Facebook _instance] fbDialogLogin:session.accessToken expirationDate:session.expirationDate];
break;
case FBSessionStateClosed:
[FBSession.activeSession closeAndClearTokenInformation];
break;
case FBSessionStateClosedLoginFailed:
break;
default:
NSLog(@"FBSessionStateUnknown: %d", state);
break;
}
不要忘記,以確保您的FacebookAppID和BundleID與您在Facebook開發人員儀表板中創建的相同!
你一定錯過了什麼。我目前有同樣的問題,但我有其他應用程序正常工作..我試圖找出什麼已經失蹤。 Facebook的開發人員沒有全面的分步整合列表... – Zennichimaro
在我的情況下,我錯過了[FBSession.activeSession handleOpenURL:url];在 - (BOOL)應用程序中:(UIApplication *)應用程序openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication註解:(id)註釋 – Zennichimaro
Sharon,我遇到同樣的問題,特別是當用戶被撤銷時權限,而應用程序仍然打開。你做了什麼來解決你的問題? – SAHM