Push Notification across Platforms
Kii Cloud can send push notifications across the push notification networks such as FCM, APNs, and MQTT.
User-based push notification
The destination of a push notification from Kii Cloud is a user. When a push notification is sent to a user, it is sent to devices that are associated with the recipient user among devices installed to Kii Cloud.
See the diagram below for an example:
Suppose User 1 installs an Android device and User 2 installs Android and iOS devices. Each device belongs to the push notification network for its platform: the Android devices are connected to FCM and the iOS device is connected to APNs.
In order to send a push notification to User 2 (), Kii Cloud sends requests to FCM and APNs for sending a push notification to all devices associated with User 2 (). FCM and APNs send a push notification to the specified Android and iOS devices ().
Target push notification network
The following actions must be taken so that Kii Cloud can communicate with push notification networks:
Configure the push notification network in the developer portal. For MQTT, no special configuration is required.
Get a device token (registration ID) for a device from the FCM or APNs server and install the device to Kii Cloud. For MQTT, a device token is not necessary but you need to install a device. A user does not receive any notification if their device is not installed.
Select the target network if the type of push notification is Push to User or Direct Push. These are two of the three types of Kii Cloud push notifications. As for Push to App notifications, devices connected to any configured push notification network receive push notifications.
Push notification to the source device
When a device is the source of a push notification, the device might also receive the notification.
See the diagram below for an example. Suppose a user has initialized an Android smartphone, iPhone, and iPad. If the user requests a push notification to themselves from the Android device to synchronize data across their devices, a push notification is sent to the source Android device in addition to the iPhone and iPad.
Development and production environments
Kii Cloud push notification can be executed for both the development and production environments. This will allow you, for example, to only send push messages to the development environment while not bothering the already-released environment.
APNs supports the development and production environments. Kii Cloud also allows you to use these two environments for FCM and MQTT.
The following actions must be taken so that Kii Cloud can communicate with push notification networks:
- Specify the environment, production or development, as an API argument when you install a device to Kii Cloud.
- Select the target network if the type of push notification is Push to User or Direct Push. These are two of the three types of Kii Cloud push notifications. As for Push to App notifications, devices connected to any configured push notification network receive push notifications.
Example of routing a push notification
Suppose the following three devices are installed to Kii Cloud:
- Device A: Android device that receives notifications in the development environment of FCM
- Device B: Android device that receives notifications in the production environment of FCM
- Device C: iOS device that receives notifications in the development environment of APNs
If a Push to User message is sent to the development environment of FCM and APNs by the API parameters, only Device A and Device C receive the push notification.