In mobile games, Push Notifications are an important means to maintain and increase user retention. Hive provides Push Notification Services to notify news in diverse ways to users. Not only provides advertisement push notification for marketing to increase retention of game, and also supports Google’s FCM and Apple’s APNS. Language-specific and timezone-specific settings are available to support global services as well.
Push Type
Remote Push
Remote Push is a push sent to the user’s device through Hive console or game server using Hive server API.
There is nothing to implement in your game to receive Remote Push. However, you should call Hive API to check and change the push settings when users intend to see or change settings of Remote Push. View details
Local Push
Local Push is a push sent by Game Client directly to users using Hive API in the game, You can register and release local push using Hive API, and customize push UI for Android devices. View details
Push Settings
The user will see the terms of agreement upon initial game play after the app installs, and will perform the consent process to receive an advertising push for marketing. However, you should provide the function to opt in or out of the service on game settings page for those who do not want to receive push notifications.
Settings Type
It should be available to opt in or out of push notifications for All Notifications, Game Notification, Announcement Notification and Night-time Notification.
All Notifications |
|
Game Notification |
|
Announcement Notification |
|
Night-time Notification |
|
Push Settings Policy
1. Provide a menu for users to activate or deactivate push services in games.
- The composition of Push Settings
- All Notifications is exposed on Android devices and available to comprise details depending on the game features.
- Night-time Notification is exposed to users in Korea only.
- The default value of All Notifications and Game Notification settings are ON.
- The default value of Announcement Notification and Night-time Notification settings are from Hive API.
- Notification setting menu when game language is Korean
(Make sure to display night-time notification settings on all devices including Android and iOS platform) - Notification setting menu when game language is not Korean
- You should display a toast popup for two seconds when push notification settings are changed.
- Expose Notice popups
- when a user logged in from Korea
- when the settings of All Notifications, Notices, Night-time Notifications changed (for Game notification, do not display toast popups)
- Texts for toast popup
- Activate All Notifications: [Company Name] 2016.05.01 You opted in to all notifications.
- Deactivate Announcement Notification: [Company Name] 2016.05.01 You opted out of announcement notification.
- Activate Night-time Notification: [Company Name] 2016.05.01 You opted in to night-time notification.
- An example of toast popup
Provide notification texts for push settings.
In case users do not receive a push, even though users have enabled it in the push settings menu, please provide instructions to check user’s notification settings in the device settings menu. Push notifications are not displayed if users opted out of notifications on device settings.
2. Use Hive API to configure settings for notification sent through Hive Console.
- Hive Console delivers two types of push notification; Announcement Notification and Night-time Notification
- The values of the two notification options must be set to the values set in the Hive server.
- You must pass changes to the Hive server when both notification options change.
- For more information, see Sending Remote Push.
3. Apply the Night-time Notification Policy.
Night-time Notification belongs to Announcement Notification. Please apply the following policies when implementing Night-time Notification settings menu.
- If a user opted out of Announcement Notification, Night-time Notification should be automatically deactivated.
- With deactivated Announcement Notification, Night-time Notification should be unable to activate.
- Even a user opted out of Announcement Notification, Night-time Notification should not be automatically activated.
Push Display Settings
Push notification is generally displayed when your game app is not in use. With Hive SDK v4.9.0, however, push service is available to expose even the app is activated. iOS is supported from iOS 10.
Push settings Class
The following classes show whether push messages are sent or not when the app is activated.
1 2 3 4 5 6 7 8 |
public class PushSetting { /* * Constructor: PushSetting() * boolean useForegroundRemotePush: Whether to display remote push or not * boolean useForegroundLocalPush: Whether to display local push or not */ public PushSetting(Boolean useForegroundRemotePush, Boolean useForegroundLocalPush); } |
1 2 3 4 5 6 7 8 9 10 |
class PushSetting { public: /* * Constructor: PushSetting() * BOOL useForegroundRemotePush: Whether to display remote push or not * BOOL useForegroundLocalPush: Whether to display local push or not */ PushSetting(bool useForegroundRemotePush, bool useForegroundLocalPush); }; |
1 2 3 4 5 6 7 8 |
public static class PushSetting { /* * Constructor: PushSetting() * boolean remotePushEnabledWhileRunning: Whether to display remote push or not * boolean localPushEnabledWhileRunning: Whether to display local push or not */ public PushSetting(boolean remotePushEnabledWhileRunning, boolean localPushEnabledWhileRunning); } |
1 2 3 4 5 6 7 8 9 10 |
@interface HIVEPushSetting : NSObject /* * Constructor: pushSettingWithRemote() * BOOL useRemote: Whether to display remote push or not * BOOL useLocal: Whether to display local push or not */ + (instancetype)pushSettingWithRemote:(BOOL)useRemote local:(BOOL)useLocal; @end |
Push settings callback
Implement the following callbacks when calling push settings API to retrieve about the request result.
1 2 3 4 5 |
/* * @param result The result of API implementation * @param pushSetting Push settings information */ public delegate void onPushSetting(ResultAPI result, PushSetting pushSetting); |
1 2 3 4 5 |
/* * ResultAPI result: The result of API request * PushSetting pushSetting: Current push setting value */ typedef std::function<void(ResultAPI const &result, PushSetting const &pushSetting)> onPushSetting; |
1 2 3 4 5 6 7 8 9 10 11 |
public interface PushSettingListener { /* * ResultAPI result: The result of API request * PushSetting pushSetting: Current push setting value */ public void onPushSetting(ResultAPI result, PushSetting pushSetting); } |
1 2 3 4 5 6 7 |
/* * HIVEResultAPI result: The result of API request * HIVEPushSetting pushSetting: Current push setting value */ typedef void (^HIVEPushSettingHandler) (HIVEResultAPI *result, HIVEPushSetting *pushSetting); |
Set whether to receive push messages on the activated app
Using the following APIs, you can set whether to receive push messages when the app is activated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Creates PushSetting objects Boolean useForegroundRemotePush = true; Boolean useForegroundLocalPush = false; PushSetting pushSetting = new PushSetting(useForegroundRemotePush, useForegroundLocalPush); public void onPushSettingCB(ResultAPI result, PushSetting setting) { if (result.isSuccess() == true) { // TODO: Confirms the details of pushSetting } } // Sets whether to receive push messages when the app is activated Push.setForegroundPush (pushSetting, onPushSettingCB); |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// Creates PushSetting objects bool useLocal = true; bool useRemote = false; PushSetting pushSetting(useRemote, useLocal); // Sets whether to receive push messages when the app is activated Push::setForegroundPush(pushSetting, [=](ResultAPI const & result, PushSetting pushSetting) { if(result.isSuccess()) { // TODO: Confirms the details of pushSetting } }); |
1 2 3 4 5 6 7 8 9 |
Push.PushSetting pushSetting = new Push.PushSetting(true, false); Push.setForegroundPush(pushSetting, new Push.PushSettingListener() { @Override public void onPushSetting(ResultAPI result, Push.PushSetting pushSetting) { // TODO: Confirms the details of pushSetting } }); |
1 2 3 4 5 6 7 8 9 10 |
// HIVECreates PushSetting objects HIVEPushSetting *pushSetting = [HIVEPushSetting pushSettingWithRemote:YES local:NO]; // Sets whether to receive push messages when the app is activated [HIVEPush setForegroundPush:pushSetting handler:^(HIVEResultAPI *result, HIVEPushSetting *pushSetting) { if ([result isSuccess]) { // TODO: Confirms the details of pushSetting } }]; |
Search whether receiving push messages on activated app
Using the following APIs, you can search the state whether receiving push messages when the app is activated.
1 2 3 4 5 6 7 8 9 |
public void onPushSettingCB(ResultAPI result, PushSetting setting) { if (result.isSuccess() == true) { // TODO: Confirms the details of pushSetting } } // Sets whether to receive push messages when the app is activated Push.getForegroundPush (onPushSettingCB); |
1 2 3 4 5 |
Push::getForegroundPush([=](ResultAPI const & result, PushSetting pushSetting) { if(result.isSuccess()) { // TODO: Confirms the details of pushSetting } }); |
1 2 3 4 5 6 7 8 |
Push.getForegroundPush(new Push.PushSettingListener() { @Override public void onPushSetting(ResultAPI result, Push.PushSetting pushSetting) { if (result.isSuccess()) { // TODO: Confirms the details of pushSetting } } }); |
1 2 3 4 5 6 |
// Searches whether receiving push messages on activated app [HIVEPush getForegroundPush:^(HIVEResultAPI *result, HIVEPushSetting *pushSetting) { if ([result isSuccess]) { // TODO: Confirms the details of pushSetting } }]; |
Provisional Authorization
Hive SDK v4.11.4 starts to support a new funtion for iOS 12, Provisional Authorization.
As the agreement popup on sending push notification is no more exposed after agreement on terms of service of Hive SDK, users who run your app receive all kinds of push messages as a default. With provisional authorization, all users can select to receive push notifications on the push message or app settings. Default setting is that push messages do not sound nor expose until user manually opts in to push notification even if the user receives the messages.
Devices with earlier than iOS 12 display the agreement popup on sending push notification after initializating Hive as usual.
Request Permission for Prominent Push
From Hive SDK v4.16.2 (Android), you can expose the agreement popup on sending prominent push notification if it’s necessary in game. To expose the agreement popup on sending prominent push notification, call requestPushPermission()
method in Push class before user set whether to agree on sending push notification.
For iOS, even if user agrees on terms of service of Hive SDK through Provisional Authorization, the agreement popup on sending push notification is exposed, and the user can receive the prominent push notification.
For Android, the pop-up is exposed when the target SDK is 33 or higher on Android 13 or higher devices, and when the target SDK is lower than 33, it is exposed when AuthV4.setup()
is called.
Followings are sample codes to expose the agreement popup on sending push notification.
API Reference: hive.Push.requestPushPermission
1 |
Push.requestPushPermission(); |
API Reference: Push::requestPushPermission
1 |
Push::requestPushPermission(); |
API Reference: HIVEPush::requestPushPermission
1 |
[HIVEPush requestPushPermission]; |
1 |
Push.requestPushPermission() |
Push Multi-Language Settings
Language | All Notifications | Game Notification | Announcement Notification |
---|---|---|---|
Korean | 모든 알림 | 게임 알림 | 공지 알림 |
English | All Notifications | Game Notification | Announcement Notification |
Japanese | 全ての通知 | ゲーム通知 | お知らせ通知 |
Chinese (Simplified) | 所有通知 | 游戏通知 | 公告通知 |
Chinese (Traditional) | 所有通知 | 遊戲通知 | 公告通知 |
German | Alle Benachrichtigungen | Spiel-Benachrichtigung | Ankündigungen |
Russian | Все уведомления | Уведомления игры | Объявления |
Malay | Semua notifikasi | Notifikasi permainan | Notifikasi pengumuman |
Vietnamese | Tất cả thông báo | Thông báo game | Thông báo tin tức |
Spanish | Todas las notificaciones | Notificación del Juego | Notificación de Anuncio |
Italian | Tutte le notifiche | Notifiche di gioco | Notifiche degli avvisi |
Indonesian | Semua Notifikasi | Notifikasi Game | Notifikasi Pengumuman |
Thai | การแจ้งเตือนทั้งหมด | การแจ้งเตือนเกม | การแจ้งเตือนประกาศ |
Turkish | Tüm Bildirimler | Oyun Bildirimi | Duyuru Bildirimi |
Portuguese | Todas as notificações | Notificação de Jogo | Notificação de Anúncios |
French | Toutes les notifications | Notification de jeu | Notification d’annonce |
Arabic | كل الإشعارات | إشعارات اللعبة | إشعارات الإخطار |