jandersen
jandersen

Reputation: 3561

Facebook MessengerExtensions in Browser?

Attempting to load the Facebook MessengerExtensions appears not to work when using the in-browser experience for Facebook messenger (as opposed to the native apps on iOS or Android). When I interact with my bot's persistent menu to open a webview (that is trying to use MessengerExtensions), I get this error in the browser console of a newly opened tab:

Messenger Extensions are not enabled - could be "messenger_extensions" was not set on a url, the domain was not whitelisted or this is an outdated version of Messenger client

I have the impression that MessengerExtensions is simply not supported for the in-browser experience but have a couple of questions:

  1. Can someone find where in the docs this lack of support is stated (because I've obviously missed it if it's there...)?
  2. If this is supported somehow, suggestions for what I might be doing wrong? (I have confirmed that my persistent menu button has messenger_extensions: true and my web_url is whitelisted...)
  3. Is there some kind of workaround (not using MessengerExtensions) for the webview opened in the browser to get the page-scoped user Id (PSUID) for the user interacting with the bot?
    • For a button generated with the Send API I could conceivably append the PSUID to the URL being opened as a query param (not sure of security considerations on that)
    • For the persistent menu the web_url of the button action is NOT dynamic (it's configured ahead of time) so I'm unsure how this URL when opened from the browser-based messenger interface is supposed to figure out what user opened it. Thoughts/Ideas?

Upvotes: 1

Views: 603

Answers (1)

Chao
Chao

Reputation: 1058

I've just tried it on the chrome with facebook api version 2.10, and it works. When I clicked on the button, I got a "lightbox" looking window that opened on top of the messenger, and all the proper callbacks are called in javascript.

this is my button json:

{
      type: 'web_url',
      title: <title>,
      url: <url>,
      messenger_extensions: true,
      fallback_url: <url>,
      webview_height_ratio: 'tall'
}

these are a few things that I did:

  • the button spec should contain messenger_extensions: true
  • facebook whitelisted_domains doesn't do subdomains, so make sure you whitelist the entire url before the parameters.
  • fallback_url should be whitelisted as well.

Upvotes: 1

Related Questions