This article describes the events that Unblu publishes push notifications for and the different channels you can use to send push notifications.
Introduction
Push notifications are a great way of maintaining engagement in long-running conversations.
For a person to receive push notifications, they must be a participant in a conversation. Unblu can send push notifications for:
-
New messages
-
Incoming video and voice calls
-
Missed video and voice calls
Push notifications are available for three different channels:
Push notifications for new messages
Push notifications related to new messages are triggered by two events:
-
New chat messages sent to a conversation
-
Messages in a conversation changing state to "read"
"New message" push notifications
Push notifications regarding new messages are sent to participants when a person or a bot sends a new message to a conversation (system messages are ignored). More specifically, a participant is sent a push notification if:
-
The participant has not read the message before the debounce timeout.
-
If the person does not have the conversation open, a short timeout is used. The short timeout is set in com.unblu.core.push_notification.pushNotificationDebounceDelay; the default value is 1 s.
-
If the person has the conversation open, a longer timeout is used. The long timeout is set in com.unblu.core.push_notification.pushNotificationDebounceDelayWhenInConversation; the default value is 10 s.
-
-
No further messages have been written in the conversation before the timeout is reached.
If a participant receives multiple messages in short succession, they will not receive a notification for each new message. They will only be notified of the last message they received.
For secondary agents and visitors, you can specify when they should be informed of new messages in a conversation with the configuration properties com.unblu.conversation.notification.secondaryAgentNotificationRule and com.unblu.conversation.notification.secondaryVisitorNotificationRule, respectively.
"New message" push notifications are on a conversation level. If a person receives new messages in multiple conversations, a notification will be sent for each conversation. |
"Read message" push notifications
Unblu maintains a count of the "new message" notifications that a participant has received in each conversation they are participating in. The count is reduced when the participant reads one of the new messages. Once the notification count for a conversation reaches 0 — that is, when the participant no longer has any unread new messages --, Unblu sends a "read message" push notification.
"Read message" push notifications are not meant to be displayed to the recipient. Rather, they are intended to be used to invalidate the notification that the participant has new messages.
"Read message" notifications are on a conversation level. A new “read message” push notification will only affect the notification count for that conversation. |
Push notifications related to incoming calls
Push notifications related to incoming video and voice calls are triggered by two events:
-
New incoming video and voice calls
-
Revoked video and voice calls, that is, when a call is terminated
"Incoming call" push notifications
"Incoming call" push notifications are sent to participants when another participant in a conversation starts a video or voice call. The other participants' call state changes to “RINGING”, which prompts the push notification.
If the setting com.unblu.conversation.call.forwardToHiddenAgents specifies that the call be forwarded to hidden agents, those agents will not receive the "incoming call" push notification until the timeout specified in com.unblu.conversation.call.callNotAnsweredTimeoutSeconds has been reached.
"Revoked call" push notifications
"Revoked call" push notifications are sent to participants in a video or voice call when the call has ended and its status changes to "IDLE". Like "read message" push notifications, these notifications are intended to invalidate any "incoming call" notifications a participant received, not to be displayed to participants.
Push notifications related to missed calls
"Missed call" push notifications are sent to participants in a conversation when their call state changes from “RINGING” to “NONE”. This can occur in three situations:
-
The caller hung up before the call was answered.
-
The call was not answered before it timed out.
-
The person being called actively declined the call.
In the first two situations, the person or people being called will receive a "missed call" push notification. In the last case, no "missed call" push notification is sent.
Notification channels
Before selecting the channels you wish to use for push notifications, you must activate push notifications generally. Do so by setting com.unblu.core.push_notification.enablePushNotification to true
.
You can specify which participants in a conversation should receive push notification based on their participant type with the setting com.unblu.conversation.notification.enablePushNotificationsPerActor.
Activate the email channel for push notifications by setting com.unblu.core.push_notification.mail.enableEmailPushNotification to true
.
Email push notifications can be sent for "new message", "incoming call", and "missed call" events. "Read message" and "revoked call" events do not result in email notifications.
-
Activate "new message" push notifications by setting com.unblu.core.push_notification.mail.enableEmailNewMessagesPushNotification to
true
. Configure the notifications with the settings whose keys begin withcom.unblu.core.push_notification.mail.messages.anonymous.
orcom.unblu.core.push_notification.mail.messages.authenticated.
for notifications sent to anonymous and authenticated participants, respectively. -
Activate "incoming call" push notifications by setting com.unblu.core.push_notification.mail.enableEmailIncomingCallPushNotification to
true
. The configuration properties whose keys begin withcom.unblu.core.push_notification.mail.call.*
are used to configure "incoming call" notifications. -
Activate "missed call" push notifications by setting com.unblu.core.push_notification.mail.enableEmailMissedCallPushNotification to
true
. The configuration properties whose keys begin withcom.unblu.core.push_notification.mail.call.missed.*
are used to configure "missed call" notifications.
Unblu must know a person’s email address before it can send them email push notifications. For agents, this information may come from ID propagation or the user database, e.g. via an LDAP sync. Authenticated visitors, too, may provide their email address by ID propagation. Other visitors may be asked for their email address as part of the concierge’s onboarding process, or they may have provided it as part of a call to the Unblu Web API endpoint persons/createOrUpdateVirtual
.
Mobile
Unblu uses Firebase for push notifications to devices running Android or iOS. You can activate mobile push notifications by setting com.unblu.mobile.push_notification.enableFirebasePushNotification to true
. You must also set the configuration properties com.unblu.mobile.push_notification.firebaseDatabaseName and com.unblu.mobile.push_notification.firebaseServiceAccountKey.
For mobile push notifications to work, the following requirements must be fulfilled:
-
The Unblu mobile SDK is integrated into your Android/iOS app.
-
Unblu push notification must be enabled in the mobile SDK. (From version 3 of SDK onwards, this will be an optional module.)
-
The person who should receive push notifications must have used your app at least once, and Unblu was initialized when they did so.
-
Unblu has received the Firebase device token for the person in question.
If a person uses your app on multiple devices and the app has authenticated them, they will receive the push notification on all of their devices. |
Webhooks
You can register webhooks to integrate Unblu push notifications into an existing push notification service. This expands the ways in which you can push notifications to your users. For example, you can notify users of events via SMS or by displaying a badge on an element of your website.
To trigger a webhook push notification, you must have an active webhook registration. There are five webhooks you can register for push notifications:
-
push_notification.new_message
andpush_notification.read_message
for push notifications related to new messages -
push_notification.incoming_call
andpush_notification.revoked_call
for push notifications related to incoming video and voice calls -
push_notification.missed_call
for push notifications related to missed video and voice calls
If Unblu received any device tokens via the mobile SDK, these are also passed on to the webhook endpoint. This allows you to push notifications to mobile devices using your current push notification infrastructure.
See also
-
Browser notifications are discussed in a separate article dedicated to that topic.
-
The article on outgoing emails describes how to customize push notification emails.
-
The article on messages states explains when messages are marked as read.
-
The sections of the Unblu guide on Android and iOS integration both contain information on push notifications; see here for Android and here for iOS.
-
The Unblu Web API reference provides more information about the webhooks you can register for push notifications.