简体   繁体   中英

Issue opening Facebook Messenger from Facebook's built-in browser

I'm looking to share a webpage to Facebook Messenger as part of a promotional campaign. Everything seems to be working in usual desktop and mobile browsers however, in Facebook's built in browser, the Facebook Messenger app is not opened and the page just anchors back to the top.

In the Facebook Developer documentation it is suggested to use the following:

window.open('fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=XXXX');

but I have also tried:

window.location.href = 'fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=XXXX';

The CTA to share is a simple element with a href="#" (assume that's why the Facebook browser is jumping me back to the top of the page) with a click event to fire the user to Facebook Messenger with the page's share information prepopulated. For example:

$('#facebookShare').on('click', function() {
    window.location.href = 'fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=XXXX';
});

This all works perfectly fine in Chrome and Safari on a mobile device but as soon as it's running in Facebook's built-in browser it simply doesn't do anything.

Any help or guidance on opening Facebook Messenger from within the Facebook app's build-in browser would be greatly appreciated.

I don't think it is possible from the Facebook browser. According to the docs :

The link works on mobile web sites on iOS and Android platforms, with native apps, but deep linking does not work with webviews.

The built in Facebook browser is a webview , so it looks like it is not possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM