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 Developer Dashboard で作成したものと同じであることを忘れないでください!