I integrated facebook in ios 6.0 as decribed
How to integrate Facebook in iOS 6 using SLRequest?
But I am not able to fetch the facebook friend list using SLRequ
I figured it how it should work.
The below code is working fine for me.
NSArray *accounts = [accountStore
accountsWithAccountType:facebookAccountType];
ACAccount *facebookAccount = [accounts lastObject];
NSString *acessToken = [NSString stringWithFormat:@"%@",facebookAccount.credential.oauthToken];
NSDictionary *parameters = @{@"access_token": acessToken};
NSURL *feedURL = [NSURL URLWithString:@"https://graph.facebook.com/me/friends"];
SLRequest *feedRequest = [SLRequest
requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:feedURL
parameters:parameters];
feedRequest.account = facebookAccount;
[feedRequest performRequestWithHandler:^(NSData *responseData,
NSHTTPURLResponse *urlResponse, NSError *error)
{
NSLog(@"%@",[[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
}];
}
else
{
// Handle Failure
}