curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"USER_ID"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Hi, go to webview",
"buttons":[
{
"type":"web_url",
"url":"https://{your-domain}/index.html",
"title":"Show Website",
"webview_height_ratio": "full",
"messenger_extensions": true,
},
]
}
}
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"
Last active
December 16, 2016 17:57
-
-
Save CasperLaiTW/a52b8f9d7e7e0a0200b2c1df98231854 to your computer and use it in GitHub Desktop.
Messenger webview bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Show Messenger is Supported</title> | |
</head> | |
<body> | |
Messenger Extension is Supported: <span id="isSupported"></span> | |
<script> | |
(function (d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) { | |
return; | |
} | |
js = d.createElement(s); | |
js.id = id; | |
js.src = "//connect.facebook.com/en_US/messenger.Extensions.js"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'Messenger')); | |
window.extAsyncInit = function () { | |
var isSupported = MessengerExtensions.isInExtension(); | |
document.getElementById('isSupported').innerText = isSupported; | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Button Template Result: