Implementing the Initialization and Reception Processes
In order to use the push notification feature in your mobile app, implement the initialization process of the feature and the message reception process by adding code like that shown in the push notification tutorial.
Initialize the push notification feature, for example, when the mobile app starts.
The initialization process needs to initialize the push notification feature of Kii Cloud (install a device) in addition to initializing FCM or JPush. For more information, see Installing a Device.
Kii Cloud provides its own push notification feature on the basis of push notification technologies such as FCM and JPush.
onMessageReceived()method of the
FirebaseMessagingServiceclass receives FCM push notifications and the
onReceive()method of the
BroadcastReceiverclass receives JPush push notifications. For the implementation, see the push notification tutorials.
Then, the payload (JSON string) of the received push message can be interpreted according to the specification of the push notification feature of Kii Cloud. The reception method in the tutorial uses
casestatements to branch the process by the three notification types:
DIRECT_PUSH. The subsequent processes should be implemented as described in Push to App Notification, Push to User Notification, and Direct Push Notification.
For the procedures to display a message in the status bar, see Push Notification Implementation Tips.