Facebook friend api 변경사항
User IDs and Friends
Graph API v2.0 includes some changes to how user IDs and friends work in order to better protect people's info. This includes several changes:
1. App-scoped User IDs
Facebook will begin to issue app-scoped user IDs when people first log into an instance of your app coded against v2.0 of the API. With app-scoped IDs, the ID for the same user will be different between apps.
No matter what version they originally used to sign up for your app, the ID will remain the same for people who have already logged into your app. This change is backwards-compatible for anyone who has logged into your app at any point in the past.
If you're not mapping IDs across apps, then no code changes should be required. If you need to map the same user IDs across multiple apps or run cross-app promotions, we've added a new API called the Business Mapping API. This lets you map a logged-in user's IDs across apps as long as those apps are all owned by the same business. Learn more about implementing cross-promotions.
For users who have not logged into your app, the user ID may change depending on the version of the API that you call. In v1.0 of the API users who have not logged into your app will be referred to by their original Facebook user ID, whereas in v2.0 they will be referred to by an app-scoped ID.
We've added new API endpoints that allow you to tag and invite friends who don't use your app. These APIs return tokens which may be used to generate custom interfaces for tagging and invitations. Those tokens aren't meant to be cachable and we make no guarantees that they will be stable beyond 24 hours from the time the API response containing them was received. They aren't the same as either the IDs used on data for people not logged into your app nor the same as the app-scoped IDs.
Users can check their app-scoped IDs for each app they've installed in the app's Edit Settings dialog. Make sure users of your app know how to find it when they contact you with support queries.
2. Friends now has a new permission
In v1.0 and earlier, the list of friends was available as part of the default permission set. To give people more control about the info they share with apps, we've separated the list of friends from the default. We have added a new permission so that you can ask for the list of friends. That permission is calleduser_friends
. In order to use user_friends
, you will need to add it to the list of scopes in your app when requesting permissions.
This offers you a new opportunity: you don't have to ask for the list of friends until a person using your app is ready to use your app socially. You can ask for this permission later in your app's login flow.
3. /me/friends
returns the user's friends who are also using your app
In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.
There are two key use cases where apps need access to non-app friends: tagging and inviting. In v2.0, we've added the Taggable Friends API and the Invitable Friends API to support these flows.
After a person has logged in with v2.0 of Facebook Login, calling /v1.0/me/friends
and/v2.0/me/friends
will both result in the v2.0 behaviour - both calls will return the set of the person's friends who also use the app.
4. All friend_*
permissions have been removed
In v1.0, it was possible to ask for permissions that would allow an app to see a limited amount of friend data, such as a person's friend's likes, their birthdays, and so on.
In v2.0, those permissions have all been removed. It's no longer possible for an app to see data from a person's friends unless those friends have also logged into the app and granted permission for the app to see it that data.
5. Friend lists are now title-only
In API v2.0 the list of friends within a friend list is no longer available, and the manage_friendlist
permission has been deprecated.
In v2.0, you can use friend lists to build a custom audience selector for making posts to Facebook. For example, limiting a post to 'Friends', 'Co-workers' or 'Old College Friends'.