Facebook SDK login crash

别等时光非礼了梦想. 提交于 2019-12-25 03:54:52

问题


Facebook login sometimes crashes. I am using the latest version of SDK.

On crashlytics I get:

FBSystemAccountStoreAdapter requestAccessToFacebookAccountStore:defaultAudience:isReauthorize:appID:session:handler:] Fatal Exception: NSInvalidArgumentException

Access options are not permitted for this account type. The options argument must be nil.

This is the code:

- (void)facebookOpenSession
{
    [SVProgressHUD show];
    FBSession* sess = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObject:@"public_profile"]];
    [FBSession setActiveSession:sess];
    [sess openWithBehavior:(FBSessionLoginBehaviorUseSystemAccountIfPresent) completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
        [SVProgressHUD dismiss];
        [self facebookSessionStateChanged:session state:status error:error];
    }];
}

I've tried setting nil for permissions as well, but crash occurs sometimes as well.

来源:https://stackoverflow.com/questions/23732342/facebook-sdk-login-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!