Skip to content

Get started

'Push notifications' is a feature that delivers informational and advertising messages to users' devices. It provides remote push, which delivers messages remotely through the Hive Axyl push server and OS-specific external push services such as FCM (Firebase Cloud Messaging) and APNs (Apple Push Notification service).

This document explains how the feature works and the implementation order before you implement 'Push notifications'.


Remote push notifications

'Remote push notifications' work as follows: the Hive Axyl push server creates a message, and the message is delivered to the user's device through FCM or APNs. The app client registers the device token issued by the push service of each OS with the Hive Axyl server, and handles arriving messages or notification tap events.

You send push messages from the Hive Console or the server API, not directly from the app client.

For server API requests, log in to the Hive Console and register the FCM token with the Hive Axyl push server so that the Hive Axyl push server sends the push. For the server send API, see Hive Axyl Push Server API.

Supported scope by OS

'Remote push notifications' use a push service and a dedicated plugin for each OS.

OS Push service Integration setup Token issuance Reception handling
Android FCM FCM integration setup FCM token issuance Push reception handling (Android)
iOS APNs APNs integration setup APNs token issuance Push reception handling (iOS)

To use FCM on Android, you need to set up the Firebase console and install the FCM plugin. To use APNs on iOS, you need to set up Apple Developer, install the APNs plugin, request notification permission, and connect the delegate callbacks.

SDK components

The remote push notification feature of the Hive Axyl SDK consists of a common module that provides server token registration and management, and Add-ons that handle token issuance and message reception for each OS.

Role Android iOS
Server token registration/management AddPush() / IPushService AddPush() / IPushService
OS token issuance AddFCM() / IFCMPlugin.GetTokenAsync() AddAPNS() / IAPNSPlugin.GetTokenAsync()
OS permission The app requests POST_NOTIFICATIONS directly IAPNSPlugin.RequestAuthorizationAsync()
Cold start retrieval GetColdStartMessageAsync() GetColdStartNotificationAsync()
Reception events NotificationReceived The delegate calls Notify*, and then NotificationPresented or NotificationOpened is raised

OS Add-ons are registered only on supported OSs. If the same code can run in the Editor, in a server build, or on another OS, protect it with an OS branch or HiveCore.TryResolve<T>().

Device token registration and management

A device token is a value that identifies the device that receives push messages. FCM issues the token on Android, and APNs issues it on iOS. The app client saves the issued token to the Hive Axyl server through Register device tokens.
Token registration uses the logged-in session. Because the token is linked to the logged-in user (Player ID), you can use it to send single pushes to a specific user.
See Change token settings to change the language and notification consent of a registered token. To stop sending notifications to that user, for example after logout, detach the token identifier.

Push notification consent is managed per token. Pass the following three items together when you register a token, and when the user changes the notification settings in the app, update them with Change notification consent.

  • Consent to receive informational notifications
  • Consent to receive advertising notifications
  • Consent to receive nighttime advertising notifications

Consent to receive nighttime advertising notifications cannot be turned on while consent to receive advertising notifications is turned off.

Reception handling

Implement the handling of messages that arrive while the app is running and of cases where the user taps a notification to launch the app (cold start) as described in the reception handling document for each OS.

The app client interprets the data included in a notification and implements actions such as screen navigation, state updates, and event handling.

Implementation order

The order for implementing 'Remote push notifications' in the app client is as follows.

  1. Install and initialize the 'Push notifications' module.
  2. Set up the integration for each OS.
  3. Request push permission: Request push notification permission on devices for each OS.
    • Android: Request the runtime notification permission for devices running Android 13 or later.
    • iOS: Request the iOS/macOS system notification permission pop-up.
  4. Get a device token issued by each messaging infrastructure service.
  5. [Common to all OSs] Register device tokens: Register the issued device token with the Hive Axyl server.
  6. Send pushes: Send push messages from the Hive Console or with the server API. The Hive Axyl SDK does not provide a method for sending remote pushes.
  7. Handle push reception: Handle push messages that arrive on each OS.
  8. [Common to all OSs] Change token settings: If needed, change the language and notification consent of the registered token, or detach the user identifier linked to the token.


Next steps

To implement the 'Push notifications' feature, first complete the 'Push notifications' module installation and initialization.