获取不带Messenger扩展程序的Facebook PSID [英] Get the facebook PSID without messenger extensions
问题描述
我正在使用Messenger机器人,并且有一个网址,即webview.对于这一部分,我使用Messenger Extension JS SDK设法获取用户的ID.
I'm working on a messenger bot and i have a web url that is a webview. For that part, with the Messenger Extension JS SDK, I manage to get the ID of the User.
但是,如果用户不在Messenger上并单击链接,则无法获取用户PSID.唯一的方法是使用帐户链接,但不能输入"web_url".
But if the user is not on messenger and click on the link, I have no way to get the user PSID. The only way is to use account linking but it's not type "web_url".
如何将用户PSID(或一些具有此参数的参数)传递到用户从漫游器打开的页面.
How to pass the user PSID (or some parameters to have it) to page that user opens from the bot.
有什么想法吗?
推荐答案
只要您知道您将URL发送给哪个用户,就使用查询字符串在URL中传递参数.
As long as you know what user youre sending the url to, use query strings to pass parameters in the url.
将用户发送到 www.myurl.com/page?psid=USERPSID
,您将在其中传递机器人可以访问的用户ID.为此,不需要Messenger扩展.
Send the user to www.myurl.com/page?psid=USERPSID
where you are passing the user id your bot has access to. Messenger extensions should not be necessary for this.
To use js to get the query params from the url from within the page your user ends up on, check out this question
这篇关于获取不带Messenger扩展程序的Facebook PSID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!