With Facebook iOS SDK 3.1.1, I'm performing login using this call -
NSArray *permissions = [[NSArray alloc] initWithObjects: @"email", @"user_birthday", @"user_location", nil];
@try {
return [FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
[self sessionStateChanged:session
state:state
error:error];
}];
}
@catch { ... }
There are rare cases when this method throws NSInvalidArgumentException
with message Access options are not permitted for this account type. The options argument must be nil.
, this is thrown from [ACAccountStore requestAccessToAccountsWithType:options:completion:]
.
Checking the Apple's docs of ACAccountStore
, I see this comment for that method:
"Certain account types (such as Facebook) require an options dictionary. This method will throw an NSInvalidArgumentException if the options dictionary is not provided for such account types. Conversely, if the account type does not require an options dictionary, the options parameter must be nil."
Apple require this to be nil except for Facebook, but this method IS called from Facebook, so Maybe this is a bug - either at Facebook or at iOS 6.0/.1, but I couldn't find anything on the web about this issue.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…