Skip to content

Push notification practical guide

To implement a single push notification feature in your app, you must combine Hive Console settings, Hive Axyl SDK calls, OS-specific plugin calls, recipe code calls, and the app's notification reception handling. First select the feature to implement, and then follow its procedure in order.

Implementation scope

The Hive Axyl push practical guide focuses on device token registration and reception handling for remote push notifications. Mobile local notifications are outside the scope of the push service Hive Axyl provides; the new Notifications example separately guides you through an implementation flow based on Unity Mobile Notifications.

The work in each step falls into one of the following categories.


Category Owner Description
External console App operator Settings you configure in the Firebase console and Apple Developer.
Hive Console App operator Settings for registering FCM or APNs sending information in the Hive Console.
Hive Axyl SDK App developer Hive Axyl SDK methods the app calls.
OS plugin App developer OS notification integration code, such as FCM, APNs, and Unity Mobile Notifications.
Recipe code App developer Recipe methods the app calls.
App code App developer Permission, reception, routing, and scheduling policies the app implements directly without going through Hive Axyl.
Hive Axyl Server API App server developer Remote push sending APIs the app server calls.


Some steps involve more than one category.

For the meaning of parameters and response fields, see the detailed procedure linked in each step.

Recipe

The Hive Axyl SDK provides remote push registration as fine-grained methods. There are separate calls to request OS notification permission, to get an FCM or APNs token, and to register the issued token with the Hive Axyl server. For APNs, you must also check the build's APNs environment when you register the token.

A recipe is source code that completes that combination in advance. Instead of installing it as a package, you copy it into your project.


Category Location Characteristics
Hive Axyl SDK Unity packages com.hive.axyl.* You install and use it. It provides push features as fine-grained methods.
Recipe Assets/Recipes/ You copy and use it. It is plain C# code that groups SDK calls by purpose.
Push recipe Assets/Recipes/Push/ PushRecipe, PushPreparation, and result types.
FCM token source Assets/Recipes/Push.Fcm/ Code for Android FCM permission requests and token issuance.
APNs token source Assets/Recipes/Push.Apns/ Code for Apple APNs permission requests, environment checks, and token issuance.
Notifications example Assets/Recipes/Notifications/ An example of remote push preparation calls and an example of Unity Mobile Notifications local notifications.


Recipes are code you copy and use

Recipes are copied into your app and become your app's code. You can use them as is or modify them to fit your app's policies.

Select a feature to implement

The feature that has a recipe is device token registration for remote push notifications. The Notifications example provides the call flow for requesting permission for, scheduling, and canceling mobile local notifications with Unity Mobile Notifications.

Remote push notifications

Push notifications that the Hive Axyl server creates and delivers to users' devices through FCM or APNs. The app registers the device token with the Hive Axyl server and handles arriving messages and notification tap events.


Implementation procedure Platform What delivers the message
Implement Google Firebase Cloud Messaging Android FCM
Implement Apple Push Notification Service iOS APNs

Mobile local notifications

Notifications that the app schedules and displays directly on the device. Because they do not go through the Hive Axyl server or the FCM or APNs sending servers, they work regardless of network connectivity or device token registration. You implement this feature with app code based on Unity Mobile Notifications, not with the push service Hive Axyl provides.


Implementation procedure Platform Implementation basis
Use the Notifications example Android/iOS Unity Mobile Notifications

Features without recipes

You implement the following features without recipes by calling the Hive Axyl SDK, OS-specific plugins, and the Hive Axyl Server API directly.

  • Send remote push messages
  • Handle remote push reception events
  • Get the cold start payload
  • Change the language and notification consent of registered device tokens
  • Detach the user identifier from device tokens
  • Route remote push payloads according to your app's policy

Common prerequisites

Whichever push notification you choose, you must prepare the following items first.


Item to prepare Required Category Where to check
Create a project and an App ID Required Hive Console Create app information
Initialize the SDK Required Hive Axyl SDK Initialize the SDK
Activate the login session Required for remote push Hive Axyl SDK Log in
Install the push module and Add-ons Required Hive Axyl SDK, OS plugin Install and initialize the push module


Device token registration for remote push uses the logged-in session. Without a login session, the token registration call is rejected with an authentication error.

Because mobile local notifications are scheduled on the device, they do not use the Hive Axyl push server or a login session. However, the app code must check and apply the app's advertising notification policy itself.

Next steps

To start with Android remote push notifications, see Implement Google Firebase Cloud Messaging. To start with iOS remote push notifications, see Implement Apple Push Notification Service. For the mobile local notification example, see Use the Notifications example.