Facebook API - How to get user's address, phone #?

点点圈 提交于 2019-11-26 08:28:09

问题


Is anyone able to get facebook user\'s address, phone # using FQL or Graph api?

Have tried the following FQL and was able to get \'Current City\' and \'Hometown\' which are under \'Basic information\' but not the \'Address\' or \'Phone\' which are under \'Contact Information\'.

SELECT name,first_name,last_name,birthday_date,current_location,hometown_location,pic,profile_url,timezone,username,profile_update_time FROM user WHERE uid IN (xxxx)


回答1:


These attributes are specifically and intentionally not available via the API, for spam prevention reasons (maybe other reasons as well)...




回答2:


Facebook did make a blog post that phone number and address fields were available by prompting for user_address and user_mobile_phone extended permissions in Jan 2011, but they since removed those permissions.

The phone fql fields are "cell" and "other_phone" but your application needs to be whitelisted to access them.




回答3:


I found phone_number in their recent documentation, but Facebook has didn't mention it anywhere else. Might be they are planning to introduce in their updates.

Link : https://developers.facebook.com/docs/ios/graph

// Add the properties particular to the type restaurant.restaurant
restaurant[@"restaurant"] = @{@"category": @[@"Mexican"],
                 @"contact_info": @{@"street_address": @"123 Some st",
                                    @"locality": @"Menlo Park",
                                    @"region": @"CA",
                                    @"phone_number": @"555-555-555",
                                    @"website": @"http://www.example.com"}};

You can see @"phone_number": @"555-555-555" in the code.



来源:https://stackoverflow.com/questions/3402270/facebook-api-how-to-get-users-address-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!