iOS Facebook Sdk 3.1 Retrieve Friend Birthday Returning Null

iOS Facebook SDK 3.1 Retrieve friend birthday returning null

I have the same problem and i solve this way.

  • First of all, be sure that you have the correct permissions.

     NSArray *permissions = @[@"user_birthday", @"friends_hometown",
    @"friends_birthday", @"friends_location"];
    [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:YES completionHandler: .....
  • Then, DO NOT USE requestForMyFriends. I try in several ways ( changing the FBRequest and this kind of things

  • Check the permissions and be sure that it was the permissions you need.

    NSLog(@"permissions::%@",FBSession.activeSession.permissions);
  • Now generate the FBRequest this way.

    FBRequest *friendRequest = [FBRequest requestForGraphPath:@"me/friends?fields=name,picture,birthday,location"];
    [ friendRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    NSArray *data = [result objectForKey:@"data"];
    for (FBGraphObject<FBGraphUser> *friend in data) {
    NSLog(@"%@:%@", [friend name],[friend birthday]);
    }}];

I finally get this data. I hope it helps you

Retrieve friend's birthday information from Facebook Connect iOS

you can use Graph api to get this info
check http://developers.facebook.com/docs/reference/api/user

Get birthdays of Friends who are using my App

facebook is remove some of the accessibility of friend in Facebook V 2.1. friend birthday is also removed. so you can't get the date of friend birthday.

List of All friends_* permissions has been removed. They include:

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

Facebook reference link

FQL query with v3.1 Facebook SDK for iOS to get birthday and email

Before you call your query, you'll need to have the user log in and ask for email and user_birthday permissions. For example:

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"email",
@"user_birthday",
nil];
return [FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
[self sessionStateChanged:session
state:state
error:error];
}];
}

The above method is used in the context of this tutorial:

https://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk/

Also check out the FQL tutorial:

https://developers.facebook.com/docs/howtos/run-fql-queries-ios-sdk/

iOS -deprecated permission-facebook friends birthday using Graph API

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:

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

ref : https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids

you Can fetch only friends

1. id,name,picture only.


Related Topics



Leave a reply



Submit