how to retrieve friend's birthday using Facebook SDK in ios?

后端 未结 5 1282
难免孤独
难免孤独 2020-12-30 17:33

I have implemented FBFriendPickerDelegate in my .h file and using the following delegate to retrieve information:

-(BOOL)friendPickerController:         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 18:03

    You will need to query for each user in the friends list before adding them to the friends list.

    By default, FBGraphUser objects in the friends list only contain 2 fields: ID and name. More information can be obtained by querying the user id of each friend.

    An example using the Graph API:

        [FBRequestConnection startWithGraphPath:[friend id] 
    completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    // result is your FBGraphUser object for the queried friend
    }
    

    UPDATE: I overlooked this: There is a way to get all friends and their birthdays using a query parameter fields. Here you can specify the fields you need. (if you have the permission)

    http://graph.facebook.com/me/friends?fields=id,name,birthday

提交回复
热议问题