Skip to main content

Mobile Plugin - Examples

Adding a New Tab

https://mobile.wazo.io

Mobile New Tab Example

// manifest.json
{
// ...
"staticTabs": [
{
"entityId": "new-tab",
"mobileIcon": "chatbox-ellipses-outline",
"context": [ "mobileTab" ],
"name": "My Plugin",
"contentUrl": "./index.html"
}
]
}

Send and receive messages between background script and tabs

https://mobile.wazo.io

Mobile Background Message Example

// tab.js
app.onIframeMessage = (msg) => {
// Do extra logic here
}

(async () => {
await app.initialize();
app.sendMessageToBackground({ value: 'ping', myData: 'abcd' });
})();


// background.js
app.onIframeMessage = (msg) => {
// Do extra logic here

// Send back a message to tab
app.sendMessageToIframe({ value: 'pong', customerId: 1234 });
}

(async () => {
await app.initialize();
app.sendMessageToBackground({ value: 'ping', myData: 'abcd' });
})();