本文档可为您解答常见问题。
使用 Facebook 登录 并向特定公共主页授予 pages_messaging 权限,即可从应用网站安装应用。授权应用将显示在高级消息功能中的公共主页设置。
可以,单个 Facebook 应用可以订阅多个主页。与 pages_messaging 权限一样,在接受应用审核后,应用即可订阅接收多个主页的 Webhook。您可以根据负载情况获取每个 Webhook 的环境。
如需阅读有关《通用数据保护条例》和 Messenger 平台的常见问题解答,请访问 Messenger 平台与《通用数据保护条例》页面。
如果使用“发送到 Messenger”插件,您可以使用 data-ref 作为传递参数,发送有关点击情境的任何信息。
用户还可通过 Messenger 中的搜索功能发现您的主页。这种情况下,您不会获得传递参数,但您可以使用帐户绑定功能将对话关联到您网站上的用户帐户。
如果应用处于开发模式,则只有应用的管理员、开发者和测试者能看到此插件。当应用经过审核并获得批准后,您就可以在应用面板的应用审核选项卡中公开提供应用。
No. Unlike subscriptions where a business can send multiple messages to people on a recurring basis, the one-time notification API limits the business to a single message per user request. If the person engages with the message, the standard messaging window will reopen.
Yes. Pages interested in using the One-time Notification API need to apply for permission. Go to the Advanced Messaging section of your Page Settings and consent to the terms. A Page will be granted permission if the Page meets our criteria.
Common uses of the API include various promotional and non-promotional use cases where the User explicitly requested a follow-up. Examples include:
Your Page is not allowed to send a notification on a topic for which the User has not agreed to receive a notification. Please see the Usage and Restrictions and Limitations sections of the One-time Notification guide for more information.
A Page can send multiple requests however, the 24-hour policy will be applied to all the requests being sent. We also have controls in place to prevent spamming users with multiple requests.
The 24 hour standard messaging window will open only if the user interacts with the opt-in message. The behavior is consistent with interactions with other elements in the Messenger experience.
Pages will need to subscribe to message_optins webhook to receive notifications about User consent.
Once a person asks to be notified, the Page will receive a token which is equivalent to a permission to send a single message to the person. The token can be used to send a message to the person outside the 24 hour window. The token can only be used once and unused tokens will expire within 1 year of creation.
Yes. However, while it is possible to send another notification request using an existing token, there is no clear benefit for the business to send these type of requests.
Token is for one-time use only. Once a token is used it can not be used again.
No. The API does not return tokens available to a Page.
Page level. Permissions for the One-time Notification API are given at the Page level.
No. The app does not need to specify any message tags when sending a message outside the 24-hour standard messaging window using this API.
发生这种情况的原因有以下几个:
下面是在 Messenger 平台集成中使用平台测试用户的解决方法:
https://graph.facebook.com/v2.6/me/accounts?access_token=[TEST_USER_ACCESS_TOKEN](文档)
https://graph.facebook.com/v2.6/me/subscribed_apps?method=POST&access_token=[TEST_USER_PAGE_ACCESS_TOKEN](文档)
GET /oauth/access_token? grant_type=fb_exchange_token& client_id={app-id}& client_secret={app-secret}& fb_exchange_token={short-lived-token}
可以,智能助手可以同时包含这两种消息功能。用户需要通过其中一种合格的触发操作来触发开放平台标准消息功能,并需要选择接收订阅消息。
从技术上来说,智能助手无法在 24 小时窗口期后向用户多次发送消息(系统不会发送这些消息)。在现有智能助手的过渡时期,这些消息可通过审核,但如果被发现会被标记。
不能,Messenger 平台提供的任何 API 都无法返回所有选择接收您智能助手消息的用户的 PSID 列表。
Webhook 调用的 X-Hub-Signature 标头包含一个字段,可用于验证调用是否来自 Facebook。
您应确保 Webhook 的响应包含状态代码 200。系统可通过此响应代码判断 Webhook 成功接收。如果未返回状态代码 200,系统就会重新调用,直到成功完成。此外,如果 Webhook 长时间一直未返回状态代码 200,我们就会发送开发者提醒。
另请注意,应及时返回成功状态代码。Webhook 调用若在 20 秒内无响应,即被视为超时。在设计代码时请确保 Webhook 得到异步处理,以便能够立即返回并单独处理成功状态代码。
有工具能显示近期 Webhook 出现的错误。如果系统无法发送 Webhook,则 Facebook 服务器将取消订阅您的网址。如需寻找此工具,请前往应用面板 > Messenger > 设置,您可以在 Webhook 说明卡内找到名为显示近期错误的按钮。