i want to fetch Facebook Mutual friends in my ios App
this is my try to get mutual friends i call with this Link
[NSString stringWithFormat:@\"me/mutua
Yes, quite easy solution i have for you.
NSString *myFriendId = [NSString stringWithFormat:@"/%@",#YourFriendId#];
NSString *hashedAccessToken = [self hmac:accessToken withKey:kAPP_SECRETE];
NSDictionary *params = @{
@"fields" : @"context.fields(mutual_friends)",
@"appsecret_proof" : hashedAccessToken,
@"access_token" : accessToken
};
/* make the API call */
[FBRequestConnection startWithGraphPath:myFriendId parameters:params HTTPMethod:@"GET" completionHandler:^
(
FBRequestConnection *connection, id result, NSError *error
){//Handle Respons;}];
And here is the hmac function (Add #import )
//SHA256 HASHMAC
- (NSString *)hmac:(NSString *)access_token withKey:(NSString *)app_secret
{
const char *cKey = [app_secret cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [access_token cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)];
const unsigned char *buffer = (const unsigned char *)[HMACData bytes];
NSMutableString *HMAC = [NSMutableString stringWithCapacity:HMACData.length * 2];
for (int i = 0; i < HMACData.length; ++i){
[HMAC appendFormat:@"%02x", buffer[i]];
}
return HMAC;
}