NSInvalidArgumentException thrown from ACAccountStore when calling [FBSession openActiveSessionWithPermissions…] on iOS 6.0 and iOS 6.0.1

后端 未结 1 1127
面向向阳花
面向向阳花 2020-12-16 17:52

With Facebook iOS SDK 3.1.1, I\'m performing login using this call -

NSArray *permissions = [[NSArray alloc] initWithObjects: @\"email\", @\"user_birthday\",         


        
1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 18:33

    I found a work around for this bug. Note that the bug is described here as well: https://developers.facebook.com/bugs/139251032898548

    The Facebook SDK does not do a null check for return value of accountTypeWithAccountTypeIdentifier. See https://github.com/facebook/facebook-ios-sdk/blob/master/src/FBSystemAccountStoreAdapter.m?source=c#L176

    To work around the problem, you can do the following check before attempting facebook lgoin:

    if ([[[ACAccountStore alloc]init] accountTypeWithAccountTypeIdentifier:@"com.apple.facebook"] == nil) {
       NSLog(@"Cannot proceed, not facebook account type identifier");
       return;
    }
    

    0 讨论(0)
提交回复
热议问题