Notifications via Custom Channel
An explanation of notifications for implementations not relying on the default communication service.
Notifications greatly enhance the user experience of the Auth Service. The Auth Service comes with a default firebase service, but can be configured to send data to an existing communication service. For more on configuring which communication service to use, see Deployment.
Older Android Versions
For users with devices running Android version 5.1 (SDK API 22) or below, notifications are required for the Auth Service to function properly.
If you are going to use your own communication service, then it needs to be able to accept a notification payload from the Auth Service. The Auth Service sends notification data as a JSON payload in the following format:
{
notificationMetaData: [
framework: <a string denoting the notification framework>,
ids: [
<array of each notification id to send the notification to>
]
],
data: {
<request relevant data here, consumed by receiving app/library>
},
body: <a string containing the body of the notification>,
title: <a string containing the title of the notification>,
type: <a string containing the type of notification, consumed by the receiving app/library>,
priority: <an integer value of the priority - 0=normal, 1=high>,
}
At minimum, the notifications must be sent with the data, body, title, and type to the users' devices.
Notification Meta Data
The meta data sent along with the notification payload is an array of how to send notifications, containing two pieces: a particular notification framework, and an array of notification ids to send the notification to, relevant to the framework. Essentially, by parsing and looping through each meta data entry, the notification id's can be routed to their correct push services, allowing a user with devices across a spectrum of notification frameworks (for example, firebase and iOS) to receive a notification on each of them.
Updated about 5 years ago