Sto usando il seguente codice (indicato sulle WWDC 2012 video):Facebook integrazione Error (Accounts.framework) in iOS6
self.accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[self.accountStore requestAccessToAccountsWithType:facebookAccountType
withCompletionHandler:^(BOOL granted, NSError *e) {
if (granted)
{
NSArray *accounts = [self.accountStore
accountsWithAccountType:facebookAccountType];
self.facebookAccount = [accounts lastObject];
} else {
// Fail gracefully...
}
}];
Ho anche aggiunto il NSDictionary
alla mia .plist
lima:
Quindi, il mio problema è che sto ricevendo la seguente eccezione:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Access options are required for this account type.'
Ho provato con questo ACAccountTypeIdentifierTwitter
e ACAccountTypeIdentifierSinaWeibo
. Non si ricevono alcuna eccezione anche se sono sempre tornando granted == NO
sua funziona bene. Ma se usiamo in questo modo, la mia app ha aggiunto le impostazioni predefinite di Facebook. Quindi il problema è che è in stato OFF. C'è qualche soluzione per questo? – sathiamoorthy