The URL Button opens a webpage in the Messenger webview. This button can be used with the Button and Generic Templates.
If the site contains App Links the button will click into a native app. If you just made the change, you can use the Sharing Debugger to request a new scrape of the site.
For more information on using the URL button, see URL Button.
Um eine Webseite mit aktiviertem SDK für Messenger-Erweiterungen in der Messenger-Webansicht anzuzeigen, musst du in der whitelisted_domains
-Eigenschaft des Messenger-Profils deines Bots Domain-Whitelisting nutzen, einschließlich für die Subdomain. Dies sorgt dafür, dass nur vertrauenswürdige Domains Zugriff auf Nutzerinformationen haben, die über SDK-Funktionen verfügbar sind.
Weitere Informationen zu Domain-Whitelisting findest du in der whitelisted_domains
-Referenz.
{
"type":"web_url",
"url":"<URL_TO_OPEN>",
"title":"<BUTTON_TEXT>",
"webview_height_ratio": "<compact|tall|full>",
"messenger_extensions": "<true|false>",
"fallback_url": "<URL_TO_FALLBACK_TO>"
}
curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"<PSID>"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Try the URL button!",
"buttons":[
{
"type":"web_url",
"url":"https://www.messenger.com/",
"title":"URL Button",
"webview_height_ratio": "full"
}
]
}
}
}
}' "https://graph.facebook.com/v21.0
/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
{ "recipient_id": "1254477777772919", "message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P" }
Property | Type | Description |
---|---|---|
| String | Type of button. Must be |
| String | Button title. 20 character limit. |
| String | This URL is opened in a mobile browser when the button is tapped. Must use HTTPS protocol if |
| String | Optional. Height of the Webview. Valid values: |
| Boolean | Optional. Must be |
| String | The URL to use on clients that don't support Messenger Extensions. If this is not defined, the |
| String | Optional. Set to |