SDK 3.1: How to tell whether SDK is using iOS6 accounts or not?

后端 未结 3 1135
别跟我提以往
别跟我提以往 2021-02-15 17:19

If I have a Facebook account set up in iOS6 but the user has switched it off, the SDK just gives me a FBSessionStateClosedLoginFailed status. From that, I can\'t tell if the use

3条回答
  •  死守一世寂寞
    2021-02-15 17:55

    With iOS 6.0 and later, when you access setting device and turn off facebook integration in your app. You can check it by code

    //Callback method for facebook authorization
    - (void)sessionStateChanged:(FBSession *)session
                      state:(FBSessionState) state
                      error:(NSError *)error
    {
        .....
        if (error) {        
            NSString *valueError = [error.userInfo objectForKey:FBErrorLoginFailedReason];
            if ([valueError compare:FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue] == NSOrderedSame)
                NSLog(@"To use your Facebook account with this app, open Settings > Facebook and make sure this app is turned on.");
        }
    }
    

提交回复
热议问题