简体   繁体   中英

How to get Facebook friends who have used our app?

I have integrated Facebook SDK in my application.

I want to get the list of the Facebook friends who have installed my app. The list should contain their details such as Facebook email id, Facebook name, etc.

I am using graph api 2.5 .

How can I achieve this?

Any help would be appreciated.

You can not get email of your friend. You can see in this link: Permission

You just get email of user who allow your app get email. And no way for you get friend of this user's email.

And you can see at invite friend: Invite Friend

My app needs the list of someone's friends that don't use the app. Can I have access to this info?

The list of someone's friends who don't use your app is no longer available in v2.0. However, you can still enable people to tag friends using the Taggable Friends API. Also, If your app is categorized as a game and you have a presence on Facebook Canvas, you can use the Invitable Friends API to render a custom invites dialog within your game. However, you'll still need to pass the tokens returned by the Invitable Friends API to the Requests Dialog to actually send the invites.

My app needs to access detailed info from friends' profiles such as friends photos, likes, and so on. Can I have access to this info?

We've removed access to friends' data in v2.0. However, we still support tagging friends through a new Taggable Friends API that you can use in your app.

Try this code..this code work for you got friend who install your app.

Refer this link for more information you got a id & name

FBSDKGraphRequest *Fbrequest = [[FBSDKGraphRequest alloc]
                                  initWithGraphPath:@"/me/friends"
                                  parameters:@{ @"fields": @"id"}
                                  HTTPMethod:@"GET"];
    [Fbrequest startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {

       NSLog(@"%@",result);


    }];

output:

在此处输入图片说明

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