Sharing to Messenger for the Web

During F8 2019, we announced our plans to launch a lighter, better and simpler Messenger designed to build closer connections between people and businesses.

Starting August 15, 2019, updated versions of the Messenger app will no longer support Share to Messenger SDK. Businesses and developers might need to make modifications to their app to trigger native OS sharing. People will be able to share content to Messenger using the native sharing features that is built into their devices. Refer to June 10, 2019 Announcement

Sharing to Messenger lets publishers easily enable their readers to share something to Messenger. Sharing to Messenger uses a deep link that enables sharing from mobile web sites to the Messenger iOS and Android native applications. The deep link will open the Messenger application directly with the share flow opened and populated with a provided link. If the Messenger app is not installed, the Deep Link will not do anything. Sharing to Messenger has the following advantages compared to the other existing options (SDK, Plugin):

  • Easiest option: Publishers can implement sharing with a few lines of code.
  • Flexible: Allows publishers to choose their own button for sharing.

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

You can implement sharing to Messenger as a link or as a method call in JavaScript.

Link

<a href=”fb-messenger://share/?link= https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fsharing%2Freference%2Fsend-dialog&app_id=123456789”>Send In Messenger</a>

JavaScript

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

Parameters

Parameter Description

app_id

Your app's unique identifier.

link

The URL that is being sent in the message. This must be URL encoded. Required parameter.

Response Data

There is no response data from this dialog.