使用 Graph API 访问用户语言?
如何使用 Facebook GRAPH API 访问用户的语言?我在权限中没有看到它,也无法通过其他方式找到它。如果用户列出他们说西班牙语或法语,我如何找到它?
How do you access a user's languages using the Facebook GRAPH API? I don't see it anywhere in the permissions and I can't find it any other way. If a user lists that they speak Spanish or French, how can I find this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以从 https://graph.facebook.com/me 获取语言。
如果您正在寻找 @chacham15 提到的用户区域设置,那么它来自区域设置变量。请参阅 https://graph.facebook.com/harikt 。
您可以尝试 http://developers.facebook.com/tools/explorer?method=GET&path =me 并查看它的实际效果。
更新:
访问语言数组需要权限
user_likes
。希望这能解决您的问题。
You can get the languages from https://graph.facebook.com/me .
If you are looking for user locale as @chacham15 mentions then its from locale variable . See https://graph.facebook.com/harikt .
You can try http://developers.facebook.com/tools/explorer?method=GET&path=me and see it in action.
Update :
The permission
user_likes
is need to access the languages array .Hope this solves your issue.
我所做的是检查用户区域设置,并假设他说该语言,例如:
What I do is to check the user locale and I assume that he speaks that language, for example:
您应该根据作为用户表一部分的区域设置变量来显示语言。您将得到一个类似于 en_US(美式英语)、en_GB(英式英语)或 fr_FR(法国法语)的值。
You should display the language based on the locale variable which is part of the user table. You will get a value that is something like en_US (us english), en_GB (british english), or fr_FR (France french).