bridge.send("VKWebAppInit", {});
VKWebAppInit — is the first event your app should send to the official client to start working with VK Bridge. Otherwise, the app may not work on iOS and Android mobile clients.
bridge.send("VKWebAppAllowNotifications", {});
VKWebAppAllowNotifications allows to request user consent for sending notifications from the app.
Sandbox
iOS, Android, Web
—
If user allowed notifications
VKWebAppAllowNotificationsResult event will be triggered with the only
result (boolean), field containing
true.
{
"type": "VKWebAppAllowNotificationsResult",
"data": {
"result": true
}
}
If user didn't allow notifications
VKWebAppAllowNotificationsFailed event will be triggered with additional data.
{
"type": "VKWebAppAllowNotificationsFailed",
"data": {
"error_type": "..."
"error_data": {
...
}
}
}
bridge.send("VKWebAppDenyNotifications", {});
VKWebAppDenyNotifications allows to disable app's notifications.
Sandbox
iOS, Android, Web
—
If user disabled notifications
VKWebAppDenyNotificationsResult event will be triggered with the only
disabled (boolean), field containing
true value.
{
"type": "VKWebAppDenyNotificationsResult",
"data": {
"disabled": true
}
}
If user cancelled disabling notifications
VKWebAppDenyNotificationsFailed event will be triggered with additional data.
{
"type": "VKWebAppDenyNotificationsFailed",
"data": {
"error_type": "..."
"error_data": {
...
}
}
}