Use this page to learn how to send push notifications to users when they are offline.
apply plugin: 'com.google.gms.google-services'
is at the end of the file to avoid compilation errors.push_channel: apns_voip
channel.
create()
method accepts one argument of the object type that has the following fields:
Field | Required | Description |
---|---|---|
deviceToken | yes | Token received from FCM/APNs. |
pushChannel | no | Channel for receiving push notifications. |
deviceToken
is a device registration token generated by the APNs or GCM/FCM. The token can be unregistered by the APNs or GCM/FCM anytime. In this case, the device should be registered again and obtain a new token. When a new token is obtained, a new subscription should be created.ios_voip: 1
parameter.
create()
method accepts one argument of the object type that has the following fields:
Parameter | Required | Description |
---|---|---|
notificationType | yes | Type of notifications:- QB.events.NOTIFICATION\_TYPE.PUSH - send push notification.- QB.events.NOTIFICATION\_TYPE.EMAIL - send email. |
payload | yes | Push notification payload. Can contain a message (string) property and many other key-value pairs (string-string). Refer here for more details. |
recipientsIds | no | Users’ IDs to deliver notification. |
senderId | yes | ID of the user who created the event. |
type | yes | Types of the notification event.- QB.events.NOTIFICATION\_EVENT\_TYPE.ONE\_SHOT - a one-time event (valid only if the date is not specified).- QB.events.NOTIFICATION\_EVENT\_TYPE.FIXED\_DATE - a one-time event that occurs at a specified date (valid only if the date is specified).- QB.events.NOTIFICATION\_EVENT\_TYPE.PERIOD\_DATE - is a reusable event that occurs within a given period from the initial date (valid only if the period is specified). |
onNotification
callback is called passing an object with the notification data.
push_channel: apns_voip
in the subscription request.ios_voip: 1
parameter in a push payload of the create event request.deviceToken
within the system. See this section to learn how to subscribe a device to push notifications.