如何使用ios中的Facebook SDK检索朋友的生日? [英] how to retrieve friend's birthday using Facebook SDK in ios?
问题描述
我已在.h文件中实现了 FBFriendPickerDelegate
,并使用以下委托来检索信息:
- (BOOL)friendPickerController:(FBFriendPickerViewController *)friendPicker
shouldIncludeUser:(id< FBGraphUser>)用户
{
NSLog(@Birthday: ,user.birthday);
返回YES;
}
但每次在NSLog上,我得到一个空值...以下是结果。生日:(null)2012-09-28 10:20:22.450
我的FacebookApp [ 455:207]生日:(null)2012-09-28 10:20:22.451
我的FacebookApp [455:207]生日:(null)2012-09-28 10:20:22.452
MyFacebookApp [ 455:207]生日:(null)2012-09-28 10:20:22.454
我的FacebookApp [455:207]生日:(null)
请告诉我是否做错了。
回答....生日可以使用Graph API检索
https://graph.facebook.com/me/friends?fields=id,name,birthday&access_token=your_access_token
另请参阅此文档
了解更多信息。
I have implemented FBFriendPickerDelegate
in my .h file and using the following delegate to retrieve information:
-(BOOL)friendPickerController:(FBFriendPickerViewController *)friendPicker
shouldIncludeUser:(id <FBGraphUser>)user
{
NSLog(@"Birthday:%@",user.birthday);
return YES;
}
but every time on NSLog I get a null value... Following is the result. I get in NSLog :
Birthday:(null) 2012-09-28 10:20:22.450
MyFacebookApp[455:207] Birthday:(null) 2012-09-28 10:20:22.451
MyFacebookApp[455:207] Birthday:(null) 2012-09-28 10:20:22.452
MyFacebookApp[455:207] Birthday:(null) 2012-09-28 10:20:22.454
MyFacebookApp[455:207] Birthday:(null)
Please tell if I am doing something wrong.
Finally got the answer....birthday can be retrieved by using Graph API
https://graph.facebook.com/me/friends?fields=id,name,birthday&access_token=your_access_token
Also refer to this documentation for more information.
这篇关于如何使用ios中的Facebook SDK检索朋友的生日?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!