I just overhauled my codebase to use the new facebook-ios-sdk 3.0 (from the previous version, 2.x or whatnot).
Everything worked great, until I realized I hadn't accounted for users who had already granted the app permission/logged in with the previous implementation of the SDK. So I tried checking to see if the accessToken was saved in NSUserDefaults, and if so, make a call to open a session:
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"FBAccessTokenKey"] &&
[[NSUserDefaults standardUserDefaults] objectForKey:@"FBExpirationDateKey"]) {
[FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// deal with state change
}
My assumption was that the user wouldn't have to fast app switch for SSO, since they already had. However, that is indeed what happens.
I'd rather not have every existing user need to re-login when upgrading.
Has anyone successfully upgraded without having to re-login?
Thanks