Method signature

The method is available only when launching games on the Android platform

The method allows to recommend the user to enable mobile push notifications from the game:

You can check if push notifications are enabled with the FAPI.UI.getPushNotificationsStatus SDK method.

If the user allowed games to send push notifications, they can be sent with the apps.sendGamePush method.

FAPI.UI.suggestToEnablePushNotifications()

Call example

function suggestToEnablePushNotifications() {
FAPI.UI.suggestToEnablePushNotifications()
}

Callback example

As a result of executing this method, the user will see a prompt to enable mobile push notifications from the game. Depending on the user’s action and an original status of the push notifications subscription (whether push notifications are disabled for the game alone or for the entire OK application in the device settings), the dialog window will be closed, an action that enables push notifications will be executed, and the callback will return the result of this action.

A callback for a positive action of the user

If push notifications from the game only were disabled:

method: “suggestToEnablePushNotifications”

result: “ok”

data: “enabled”

If push notifications from the OK application in the device settings were disabled:

method: “suggestToEnablePushNotifications”

result: “ok”

data: “device settings opened”

A callback for a case when the user refused to enable push notifications

method: “suggestToEnablePushNotifications”

result: “error”

data: “cancel”

A callback for a case when push notifications are already enabled

method: “suggestToEnablePushNotifications”

result: “error”

data: “already enabled”

A callback for a case when the method is not supported by the client

method: “suggestToEnablePushNotifications”

result: “error”

data: “not_supported”