Show Alert
window.OpenWeb3.WebApp.showAlert("Hello, OpenWeb3!")
Show Popup
window.OpenWeb3.WebApp.showPopup({
title: 'Popup title',
message: 'Popup message',
buttons: [
{id: 'delete', type: 'destructive', text: 'Delete all'},
{id: 'faq', type: 'default', text: 'Open FAQ'},
{type: 'cancel'},
]
}, function(button_id) {
if (button_id == 'delete') {
window.OpenWeb3.WebApp.showAlert("'Delete all' selected");
} else if (button_id == 'faq') {
window.OpenWeb3.WebApp.openLink('https://docs.openweb3.io/reference/initialization-1');
}
});
Request Dismiss
window.OpenWeb3.WebApp.close()
Request Expand
window.OpenWeb3.WebApp.expand()
Open Link
window.OpenWeb3.WebApp.openLink("https://docs.openweb3.io/reference/initialization-1")
Open New WebApp
window.OpenWeb3.WebApp.openWebAppLink("https://mini-app-me-host/botUserName/miniAppName?startattach=xxx")
QRCode
window.OpenWeb3.WebApp.showScanQrPopup( {text: 'Request scan qrcode by wallet.'}, result => {
console.log(result)
return true
})
Select Contact
window.OpenWeb3.openWebAppLink("https://mini-app-me-host/botUserName/miniAppName?startattach=send-assetCurrency__&choose=users")
Custom Method
window.OpenWeb3.WebApp.invokeCustomMethod( "your custom method name", "params", (err,eventData)=> {
console.log(eventData)
})