简体   繁体   中英

Get real id of facebook friends

Currently when user try to join my app with Facebook I get his info with his real id. I want to get his friends. Currently i can get them only with taggable_friends. But there the id is not real... I need the real id, because I want the user to send message to other Facebook users in my app and when the other join my app, I will use his id to find in my database this message.

If you have any idea to make this connection, please help me.

You cannot get user id's off all friends. This feature is removed in v2. Since April, 2015, you cannot use v1. Check out https://developers.facebook.com/docs/apps/changelog https://developers.facebook.com/docs/graph-api/reference/v2.3/user/friends

First you need to get user_friends permission for each users. Then you can use /me/friends to get all friends that install your app previously. Therefore you don't need id of all friends, ids of friends who install your app are sufficient. In other words, you do the matching using new user's friend ids, not the former one.

Suppose user A installs your app. You get the friends list and find there is no friends using your app. Then a new user B installs your app. If A and B are friends, then getting friends list of B will yield A as a result. Since you have id of A, and ids of B's friends (who installs your app), you can match them.

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