Game push notifications

On OK, games can send mobile push notifications on behalf of applications to users that play them.

You have access (if you passed moderation previously) to the API that lets you check if you can send push notifications to users, suggest them to enable push notifications, and, of course, send them.

Push notifications can be viewed by users that have installed the OK application for Android or iOS, and look like this:

     

The SDK for game push notifications

The OK Gaming Platform provides you with API and SDK methods for working with push notifications. These methods allow you to:

How to check the subscription status via the API

You can do a preliminary check of whether push notifications (and common notifications) are enabled or disabled for the user by using the apps.getUserSubscriptions method. You need to call this method on the server instead of the user’s session. With its help, you will be able to get the subscription status for any user who actively plays your game.

This method is available for all games by default and does not require additional rights.

How to check the subscription status on a device

Since push notifications are tied to the user’s device, it is important to check the status of subscription to push notifications from your game, as well as if the user enabled receiving push notifications from an app on OK in their device on which they play games.

To do this, you can use the FAPI.UI.getPushNotificationsStatus method from the FAPI SDK. With this method, you can learn the status of subscription to push notifications on the user’s device and, if they are disabled, suggest the user to enable them (with help of the method described below).

This method is also available for all games by default and does not require additional rights.

How to suggest enabling push notifications on the device

If the user disabled push notifications from your game or all push notifications from the OK app, you may suggest the user to enable them with the FAPI.UI.suggestToEnablePushNotifications from the FAPI SDK..

This method is also available for all games by default and does not require additional rights.

How to send push notifications to the user via the API

If the user allowed the game to send push notifications, they can be sent with the apps.sendGamePush method. Since push notifications are a very invasive mechanic, this method has a variety of restrictions and checks that you will have to review and pass before starting to sent push notifications to users.

To learn more about restrictions and checks, please review the documentation for the method of sending push notifications.

This method requires you to pass moderation and is not available for games by default.

Moderation

This method is not available for all applications by default. To enable it, you have to pass moderation.

If your application has no rights to send push notifications, the method will return an error:

PERMISSION_DENIED : This method is allowed for white listed applications only

To pass moderation, you have to provide the OK team with the following data:

  • the ID of the application that requires access to game push notifications;
  • all types of push notifications that you plan to send to users. You also have to list texts that are going to be sent in push notifications.

If necessary, you can also request:

  • the change of limit of push notifications sent to users;
  • the change of limit of the last app launching date.

You will need to explain the necessity to change these settings of your application.