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.