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

不羁岁月 提交于 2019-11-29 03:55:29

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