iOS -deprecated权限 - Facebook的朋友生日使用Graph API [英] iOS -deprecated permission-facebook friends birthday using Graph API
问题描述
我正在尝试从Facebook帐户获取所有朋友的生日。
我遵循 Developers.facebook
我已经请求了所有必要的权限: user_friends
, friends_birthday
, read_stream
。我还在
首先我使用图形路径: @/ me /朋友?场=姓名,身份证,生日
。正在返回只使用 的朋友 的 。
试过 @/ me / taggable_friends
。在开发者网站中,我们只能访问这个taggable_friends的三个字段: id,name,picture
。
我发现 facebook已经弃用了朋友的详细信息权限。请参阅 https://developers.facebook.com/docs/apps/upgrading
- (void)pickFriendsClick
{NSArray * permissions = [[NSArray alloc] initWithObjects:@user_birthday,@friends_hometown,@friends_birthday,@friends_location,nil];
if(![[FBSession activeSession] isOpen]){
if(APP.fb){
APP.fb = [[FBSession alloc] initWithPermissions: ]的权限;
}
}
FBRequest * friendRequest = [FBRequest requestForGraphPath:@/ me / taggable_friends];
[friendRequest startWithCompletionHandler:^(FBRequestConnection * connection,id result,NSError * error){
NSArray * data = [result objectForKey:@data];
NSMutableArray * friends = [data mutableCopy];
NSSortDescriptor * sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@updated_timeascending:TRUE];
[friends sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
(FBGraphObject< FBGraphUser> *朋友的朋友){
NSLog(@%@:%@,[朋友姓名],[朋友生日]);
}}];
从v2.0中删除的权限列表。您的应用程序不应要求从Facebook Ver 2.0中获取以下任何内容:
create_event
manage_friendlists
read_requests
user_checkins
user_notes
user_online_presence
user_questions
user_subscriptions
xmpp_login
friends_about_me
friends_actions.books
friends_actions.fitness
friends_actions.music
friends_actions.news
friends_actions.video
friends_actions:APP_NAMESPACE
friends_activities
friends_birthday
friends_checkins
friends_education_history
friends_events
friends_games_activity
friends_groups
friends_hometown
friends_interests
friends_likes
friends_location
friends_notes
friends_online_presence
friends_photos
friends_questions
friends_relationships
friends_relationship_details
friends_religion_politics
friends_status
friends_subscriptions
friends_videos
friends_website
fr iends_work_history
ref: I am new to iOS .
I am trying to fetch birthdays of all friends from a Facebook account.
I followed Developers.facebook I have requested all the necessary permissions : First I used the graph path : I searched in the web and tried out I found that facebook has deprecated friends details permissions. Please refer https://developers.facebook.com/docs/apps/upgrading -(void)pickFriendsClick
{
The full list of permissions that have been removed from v2.0. Your app should not ask for any of the following from Facebook Ver 2.0: ref : https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids you Can fetch only friends
这篇关于iOS -deprecated权限 - Facebook的朋友生日使用Graph API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
1。 id,name,图片。
user_friends
, friends_birthday
, read_stream
. I have also set permissions in the Graph Api Explorer.@"/me/friends?fields=name,id,birthday"
. It is returning only name and id of friends who have used the app.@"/me/taggable_friends"
. It is given in the developer site that we can access only three fields for this taggable_friends : id,name,picture
.
NSArray *permissions = [[NSArray alloc] initWithObjects: @"user_birthday",@"friends_hometown",@"friends_birthday",@"friends_location",nil];
if (![[FBSession activeSession]isOpen]) {
if (APP.fb) {
APP.fb =[[FBSession alloc]initWithPermissions:permissions];
}
}
FBRequest *friendRequest = [FBRequest requestForGraphPath:@"/me/taggable_friends"];
[friendRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSArray *data = [result objectForKey:@"data"];
NSMutableArray *friends= [data mutableCopy];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"updated_time" ascending:TRUE];
[friends sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
for (FBGraphObject<FBGraphUser> *friend in friends) {
NSLog(@"%@:%@", [friend name],[friend birthday]);
}}]; }
create_event
manage_friendlists
read_requests
user_checkins
user_notes
user_online_presence
user_questions
user_subscriptions
xmpp_login
friends_about_me
friends_actions.books
friends_actions.fitness
friends_actions.music
friends_actions.news
friends_actions.video
friends_actions:APP_NAMESPACE
friends_activities
friends_birthday
friends_checkins
friends_education_history
friends_events
friends_games_activity
friends_groups
friends_hometown
friends_interests
friends_likes
friends_location
friends_notes
friends_online_presence
friends_photos
friends_questions
friends_relationships
friends_relationship_details
friends_religion_politics
friends_status
friends_subscriptions
friends_videos
friends_website
friends_work_history
1. id,name,picture only.