Facebook 从应用程序选项卡获取用户 ID
Facebook 应用程序可以有一个选项卡,用户可以根据需要将其添加到其个人资料的选项卡中。
我如何获取 uid 或以其他方式识别当前登录的用户以便为他自定义布局?
谢谢。
Facebook apps are allowed to have a tab that a user can add to his profile's tabs if he wants.
How can I get the uid or otherwise identify the currently logged in user in order to customize the layout for him please?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如此处所述:
用户与您的选项卡交互后,访客 ID 将作为请求参数传递。我找不到确切的参数名称,因为他们删除了一个 wiki 页面,该页面曾经包含所有传递参数的列表,但如果您转储所有请求变量,您应该能够看到它(但在第一次访问期间看不到)。
As noted here:
Visitor id is passed as request parameter after a user interacts with your tab. I can't find exact parameter name as they removed a wiki page that used to contain a list of all passed parameters, but if you dump all your request vars you should be able to see it (but not during the first visit).
一些来源来做到这一点+您必须在应用程序设置中打开所有迁移项目
http://nathrondevblog.blogspot.com/2010/09/how-to-get-user-id-in-profile-tab.html
some sources to do it + you must have turned on all items on migration in app settings
http://nathrondevblog.blogspot.com/2010/09/how-to-get-user-id-in-profile-tab.html
试试这个,
如果用户已登录。您可以直接从查询字符串中获取 user_id、session_key 等。
Try out this one,
If the user is logged in. You can directly get the user_id, session_key etc from the querystring.