Learn how to send push notifications to users when they are offline.
build.gradle
file.build.gradle
file.build.gradle
file.google-services.json
file from your Firebase Project dashboard and put it into your app folder in your Android project.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.Argument | Required | Description |
---|---|---|
eventType | yes | Types of the notification event:- QBNotificationEventTypes.ONE_SHOT - a one-time event (valid only if the date is not specified).- QBNotificationEventTypes.FIXED_DATE - a one-time event that occurs at a specified date (valid only if the date is specified).- QBNotificationEventTypes.PERIOD_DATE - is a reusable event that occurs within a given period from the initial date (valid only if the period is specified). |
notificationEventType | yes | Type of notifications:- QBNotificationTypes.PUSH - send push notification.- QBNotificationTypes.EMAIL - send email. |
senderId | yes | ID of the user who created the event. |
payload | yes | Push notification payload. Can contain a message (string) property and many other key-value pairs (string-string). Refer here for more details. |
pushType | no | Channel for delivering notification. Used only if the notification type is QBNotificationTypes.PUSH, ignored in other cases. If a QBNotificationPushTypes is not present, the notification will be delivered to all possible devices/platforms for specified users. Possible values are:QBNotificationPushTypes.APNSQBNotificationPushTypes.APNS_VOIPQBNotificationPushTypes.GCMQBNotificationPushTypes.MPNS |
deviceToken
within the system and is set in the subscription
. See this section to learn how to subscribe a device to push notifications.