Web View
Web Webview
var msgId = null, body = null;
function onPostMessage(event) {
if (!event || !event.data || !event.data.msgId) return; //required. check for msgId
msgId = event.data.msgId;
if (event.data.body) {
try {
body = JSON.parse(event.data.body);//optional body to be passed from AI builder.
//this body can be used anywhere in the code later
} catch(error){
console.error('Error on parsing body data', error);
}
}
}
window.addEventListener('message', onPostMessage);
parent.postMessage({ type: "webview.frame.ready" }, '*');//trigger this whenever webview is ready to be displayed
//call this function with text(to be shown in chat) along with optional data
function closeFrame(text, data) {
//data passed here will be available as a res param in the Res function of webview.
parent.postMessage({ type: "webview", jsonData: JSON.stringify(data || {}), msgId: msgId, text: text }, '*');
}Facebook Webview
Setting Webview Template URL (Required Domain Whitelisting)
Setting Webview Height

Adding the IntelliTicks Messenger Extensions SDK
1. Include the Messenger Extensions JS SDK
2. Wait for the SDK load event
Get Webview Req Body Data
Send Webview Data
Closing the Webview
Setting Webview Title
Last updated
Was this helpful?