简体   繁体   中英

Get the relationship status of user's Facebook friends

This is what I'm using now:

if ([FBSDKAccessToken currentAccessToken]) {
    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                                  initWithGraphPath:@"/me?fields=id,name,friends{relationship_status}"
                                  parameters:nil
                                  HTTPMethod:@"GET"];
    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                          id result,
                                          NSError *error) {
        NSLog(@"Result: %@", result);
    }];
}

but the result contains an empty list of friends. I guess this list contains the friends that have installed this same app.

Using the Graph Tool Explorer I can get this list

GET /v2.3/me?fields=id,name,friends{relationship_status,gender}

How can I get this list in iOS?

Permissions that I'm calling are:

loginButton.readPermissions = @[@"public_profile", @"email", @"user_friends"];

***** UPDATE *****

Ok, I've read the confirmation: "Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app."

Has anyone used taggable_friends or something like that to get the list of friends making more requests later to get the information about each and every friend? Is this something Facebook can reject when submitting the app?

That's not possible, because all friends_* permissions have been removed. Please don't waste your time trying to find a workaround.

See

All friends_* permissions have been removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM