First of all, I don't want to use Facebook SDK, so I managed to do this, which is working, but I don't know how to retrieve user's email, even though it is on my permissions request.
ACAccountStore *account = [[ACAccountStore alloc] init];
ACAccountType *accountType = [account accountTypeWithAccountTypeIdentifier:accountTypeName];
NSDictionary *options;
if ( [accountTypeName isEqualToString:ACAccountTypeIdentifierFacebook]){
options = @{
ACFacebookAppIdKey: @"601517946570890"
,ACFacebookPermissionsKey: @[@"email"]
};
}
[account requestAccessToAccountsWithType:accountType options:options completion:^(BOOL granted, NSError *error)
{
if (granted == YES)
{
NSArray *arrayOfAccounts = [account accountsWithAccountType:accountType];
if ([arrayOfAccounts count] > 0)
{
_account = [arrayOfAccounts lastObject];
NSDictionary *dict = @{
@"name": [_account userFullName] == nil ? [_account username] : [_account userFullName],
@"account_id": [_account identifier],
@"email": @"??"
};
NSLog(@"account info: %@",dict);
}
}
}];
there is no property on ACAccount that returns user e-mail, so I tried to find if it had to be done via SLRequest and couldn't find it.
Is it possible?