Enable push notifications for
mobile chat
Push notifications for mobile chat are configured through AWS End User Messaging.
You can enable push notifications for mobile chat on iOS or Android devices, allowing you to
alert customers about new messages even when they aren't actively using your mobile
application. You can enable this feature in your existing app integrated with the Amazon Connect mobile SDKs, a webview solution
The following steps and resources will help you get started with integrating Amazon Connect push notifications into your native mobile applications:
Step 1: Obtain
credentials from Apple's APNs and Google's FCM console
In order to set up Amazon Connect so that it can send push notifications to your apps, you first have to obtain credentials from Apple's APNs and Google's FCM console that will enable AWS End User Messaging to send notifications to your mobile applications. The credentials that you provide, depend on which push notification system you use:
-
For Apple Push Notification service (APNs) credentials, see Obtain an encryption key and key ID from Apple
and Obtain a provider certificate from Apple in the Apple Developer documentation. -
For Google's Firebase Cloud Messaging (FCM) credentials they can be obtained through the Firebase console, see Firebase Cloud Messaging
.
Step 2: Create
an AWS End User Messaging service application using the AWS console and enable
the push notification channel for FCM or APNs
Before you can enable Amazon Connect to send push notifications, you first have to
create an AWS
End User Messaging application and enable the push notifications channel in
the AWS
console
Follow these directions to create an application and enable any of the push channels. To complete this procedure you are only required to enter an application name. You can enable or disable any of the push channels at a later time:
-
Open the AWS End User Messaging Push console at https://console.aws.amazon.com/push-notifications/
-
Choose Create application.
-
For Application name enter the name for your application.
-
(Optional) Follow this optional step to enable the Apple Push Notification service (APNs).
-
For Apple Push Notification service (APNs) select Enable.
-
For Default authentication type choose either:
-
If you choose Key credentials, provide the following information from your Apple developer account. AWS End User Messaging Push requires this information to construct authentication tokens.
-
Key ID – The ID that's assigned to your signing key.
-
Bundle identifier – The ID that's assigned to your iOS app.
-
Team identifier – The ID that's assigned to your Apple developer account team.
-
Authentication key – The .p8 file that you download from your Apple developer account when you create an authentication key.
-
-
If you choose Certificate credentials, provide the following information:
-
SSL certificate – The .p12 file for your TLS certificate.
-
Certificate password – If you assigned a password to your certificate, enter it here.
-
Certificate type – Select the type of certificate to use.
-
-
-
-
(Optional) Follow this optional step to enable the Firebase Cloud Messaging (FCM).
-
For Firebase Cloud Messaging (FCM) select Enable.
-
Choose Token credentials for Default authentication type, then choose your service JSON file.
-
-
Choose Create application.
Step 3: Associate the
AWS End User Messaging application with an Amazon Connect instance
To enable push notifications on an Amazon Connect
instance, you will need to associate an AWS End User Messaging application
with an Amazon Connect
instance by calling the CreateIntegrationAssociation API with the PINPOINT_APP
IntegrationType. You can call this API with AWS CLI
or the Amazon Connect SDK
Step 4: Get device
token with FCM or APNs SDK, and register it with Amazon Connect
You will need to fetch the device token and use it to register an end-user mobile device with an Amazon Connect chat contact to send push notifications for new messages in the chat. Read the below FCM/APNs developer documentation for how the device token is generated and obtained from the mobile application.
-
For Apple Push Notification service (APN), see Registering your app with APNs
in the Apple Developer documentation. -
For Firebase Cloud Messaging (FCM), see Best practices for FCM registration token management
.
To register the device with a chat contact, we recommend that you do the following:
-
When the mobile application calls the StartChatContact API, pass the
deviceToken
anddeviceType
as contact attributes. For webview and hosted communication widget users, see How to pass contact attributes into the communications widget for more details. -
Embed a call to the CreatePushNotificationRegistration action in a Lambda function in a contact flow. The flow block should read
deviceToken
anddeviceType
from the user-defined contact attributes, and theinitialContactId
from the system attributes, then pass these values to the Lambda function.-
Depending on your use case, place the Lambda function either immediately after starting the chat (at the beginning of the flow) if you want the end user to receive push notifications immediately, or right before routing the contact to a queue so that they will receive the contact only an when agent is about to join. Once the API call is made, the device will start receiving push notifications when a new message comes from the agent or system. By default, push notifications will be sent for all the system and agent messages.
-
-
(optional) Embed a call to the DeletePushNotificationRegistration action in a Lambda function in a flow. Once the API call is made, the device will stop receiving push notifications when a new message comes from the agent or system.
Step 5: Receive push
notification on your mobile applications
Check out our Amazon Connect Chat UI Examples
Monitor your usage for push
notifications
To ensure the reliability, availability, and performance of your push notifications, it's crucial to monitor their usage. You can track this information through several channels:
-
AWS provides comprehensive monitoring tools for push notifications. For more information, see Monitoring AWS End User Messaging Push.
-
Depending on the push notification service you're using, you can access additional usage data through their respective consoles.
-
Firebase Cloud Messaging (FCM) : Consult the FCM documentation on Understanding message delivery
for insights into your FCM usage. -
Apple Push Notification service (APNs) : Review the APNs documentation section on Viewing the status of push notifications using Metrics and APNs
to monitor your notification status.
-