javascript - Messenger Extensions - FB Shared Link -
i have web page have added messenger extension sharing message messenger. have followed link follows. https://developers.facebook.com/docs/messenger-platform/webview/sharing/v2.10
the message object trying share follows:
var messagetoshare = { "attachment": { "type": "template", "payload": { "template_type": "generic", "elements": [{ "title": "title text", "image_url": "image url", "subtitle": "subtitle text", "default_action": { "type": "web_url", "url": "url" }, "buttons": [{ "type": "web_url", "url": "button url", "title": "button title" }] }] } } }
and code share follows:
$('#share-messenger').click(function () { messengerextensions.beginshareflow(function success(response) { if (response.is_sent) { console.log("shared in messenger") } else { console.log("did not share in messenger") } }, function error(errorcode, errormessage) { console.log("error in sharing in messenger " + errorcode + ", " + errormessage) }, messagetoshare, "broadcast"); });
i getting error follows in above error callback when click on button.
messenger extensions not enabled - "messenger_extensions" not set on url, domain not whitelisted or outdated version of messenger client.
i went through troubleshooting guide unable understand same. there point follows.
when opening webview persistent menu or button, ensure messenger_extensions parameter set true.
which did't understand.
can explain me error or going wrong?
in messagetoshare
object, need set messenger_extensions: true
on button enable messenger extensions sdk in webview:
"buttons": [{ "type": "web_url", "url": "button url", "title": "button title", "messenger_extension": true }]
Comments
Post a Comment