Sharing to Messenger for the Web

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.

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.