Facebook recently added webview support to the Messenger Bot API. However, as per the documentation, it’s only supported on iOS and Android devices.
If I try to click a webview button in desktop, it opens the URL (or the fallback URL, if defined) in a new window, thus breaking the user experience.
Is there any way to detect if the user’s client has webview support?
Example: if user is using iOS/Android, present a webview with a nice datepicker. If not, ask him to type the date in some format.
3
Answers
As far as I know current facebook API doesn’t allow you you know to get that info (like user-agent) from the user.
I am not sure but I think you can use below code to check the support for webview. It returns boolean value.
I think this has all changed. The
MessengerExtensions
has a functiongetSupportedFeatures
where you could check for whichever features you require. But in general I believe you can now useMessengerExtensionsSDK
features in desktop. It shows the app that would be webviewed on mobile in an iFrame on desktop.