For AI agents: see the complete documentation index at /llms.txt.
Overview
Updated
Introduces offline push notification services.
Chat supports integration of Google Firebase Cloud Messaging (FCM), which enables developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
Chat supports integration of Apple Push Notification service (APNs), which enables iOS developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
When a user goes offline because of client disconnection or the app process closing, Chat will push notifications to the offline user's device through the APNs message push service.
To use APNs offline push, configure the push certificate information in Agora Console and call bindDeviceToken provided by the client SDK to upload the device token to the Agora server.
To test the offline push function, download our demo.
Understand the tech
The following figure shows the basic workflow of offline push:
-
User B initializes the FCM push SDK and checks whether FCM push is configured.
-
User B obtains the device token from the FCM push server according to the configured FCM push SDK.
-
The FCM push server returns the device token to user B.
-
User B uploads the push certificate name and device token to the Agora Chat server.
-
User A sends a message to User B.
-
The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
-
If user B is offline, the Agora server determines whether the user has configured FCM push.
-
The Agora server sends the message to the FCM push server.
-
The FCM push server sends the message to user B.
-
User B registers with the APNs push service and obtains a push token.
-
APNs returns a push token.
-
User B uploads the push certificate name and push token to the Agora Chat server.
-
User A sends a message to User B.
-
The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
-
If user B is offline, the Agora Chat server determines whether the user has APNs configured.
-
The Agora server sends the message to the APNs push server.
-
The APNs push server sends the message to user B.
The device token is the push token provided by APNs push. That is, the push token generated by the APNs SDK for the client app instance when your application is first launched. This token is used to identify every app on every device. APNs uses this token to clarify which device the message is sent to, and then forwards the message to the device. The device then notifies the app. You can call the registerForRemoteNotifications method to obtain the token. In addition, if you do not unbind the device token when logging out (pass NO to the aIsUnbindDeviceToken parameter when calling logout), the user will still receive offline push notifications during the validity period of the push certificate and the token.
Chat supports integration of Google Firebase Cloud Messaging (FCM), which enables developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
Chat supports integration of offline push services that feature low latency, high delivery, high concurrency, and no violation of the users' personal data. The Web SDK itself does not support offline push; instead it supports offline push configuration on mobile platforms.
When a user goes offline because of client disconnection or the app process closing, Chat will push notifications to the offline user's device through the FCM message push service.
When a user goes offline because of client disconnection or the app process closing, Chat will push notifications to the offline user's device.
When the user is online again, the server will send the messages received while they were offline.
For example, when you are offline and another user sends you a message, a notification will pop up on your phone. When you open the app and log in successfully, Chat will actively pull the messages sent when you were offline.
If the app is running in the background and the user is still online, Chat will not push notifications. When multiple devices are logged in, you can configure the push certificate page in the Agora Console to send push notifications when either all or some of them are offline. This configuration is effective for all push channels.
When the app is running in the background or the phone is locked and the client has not disconnected from the Agora server, Chat will not receive offline push notifications. When multiple devices are logged in, if a device is forced offline, the notifications will not be received even if offline push is configured.
To use third-party offline push, configure the push certificate information in Agora Console. For example, for FCM push configure the FCM push certificate information, such as Private Key and Certificate Name. Then call updatePushConfig provided by the client SDK to upload the device token to the Agora server.
const params = {
deviceId: WebIM.conn.clientResource, // Device ID, used to identify the device.
deviceToken: 'deviceToken', // Push token to identify each app on each device.
notifierName: 'PUSH_CERT_NAME', // Certificate name for push service.
};
WebIM.conn.uploadPushToken(params);Understand the tech
The following figure shows the basic workflow of offline push:
- User B initializes the FCM push SDK and checks whether FCM push is configured.
- User B obtains the device token from the FCM push server according to the configured FCM push SDK.
- The FCM push server returns the device token to user B.
- User B uploads the push certificate name and device token to the Agora Chat server.
- User A sends a message to User B.
- The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
- If user B is offline, the Agora server determines whether the user has configured FCM push.
- The Agora server sends the message to the FCM push server.
- The FCM push server sends the message to user B.
Chat SDK provides the following features:
- Set up push notifications for the app;
- Get push notifications from apps;
- Set up push notifications for your conversation;
- Get push notifications for conversations;
- Clear push notifications for a conversation;
- Configure push translation;
- Configure a push template;
- Configure force push;
- Configure a silent message.
Chat supports integration of Google Firebase Cloud Messaging (FCM), which enables developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
To use FCM offline push, configure the FCM push certificate information, such as Private Key and Certificate Name in Agora Console. Then call the API provided by the client SDK to upload the device token to the Agora server.
To test the offline push feature, download our demo.
Understand the tech
The following figure shows the basic workflow of offline push:
- User B initializes the FCM push SDK and checks whether FCM push is configured.
- User B obtains the device token from the FCM push server according to the configured FCM push SDK.
- The FCM push server returns the device token to user B.
- User B uploads the push certificate name and device token to the Agora Chat server.
- User A sends a message to User B.
- The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
- If user B is offline, the Agora server determines whether the user has configured FCM push.
- The Agora server sends the message to the FCM push server.
- The FCM push server sends the message to user B.
Chat supports integration of Google Firebase Cloud Messaging (FCM), which enables developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
To use FCM offline push, configure the FCM push certificate information, such as Private Key and Certificate Name in Agora Console. Then call updateFCMPushToken provided by the client SDK to upload the device token to the Agora server.
Understand the tech
The following figure shows the basic workflow of offline push:
- User B initializes the FCM push SDK and checks whether FCM push is configured.
- User B obtains the device token from the FCM push server according to the configured FCM push SDK.
- The FCM push server returns the device token to user B.
- User B uploads the push certificate name and device token to the Agora Chat server.
- User A sends a message to User B.
- The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
- If user B is offline, the Agora server determines whether the user has configured FCM push.
- The Agora server sends the message to the FCM push server.
- The FCM push server sends the message to user B.
The device token is the push token provided by FCM push. That is, the registration token generated by the FCM SDK for the client app instance when your application is first launched. This token is used to identify every app on every device. FCM uses this token to clarify which device the message is sent to, and then forwards the message to the device. The device then notifies the app. You can call the await FirebaseMessaging.instance.getToken() method to obtain the token. In addition, if you do not unbind the device token when logging out (pass false to the unbindToken parameter when calling logout), the user will still receive offline push notifications during the validity period of the push certificate and the token.
Chat supports integration of Google Firebase Cloud Messaging (FCM), which enables developers to use an offline push notification service. The service features low latency, high delivery, high concurrency, and no violation of the users' personal data.
To use FCM offline push, configure the FCM push certificate information, such as Private Key and Certificate Name in Agora Console. Then call updatePushConfig provided by the client SDK to upload the device token to the Agora server.
To test the offline push feature, download our demo.
Understand the tech
The following figure shows the basic workflow of offline push:
- User B initializes the FCM push SDK and checks whether FCM push is configured.
- User B obtains the device token from the FCM push server according to the configured FCM push SDK.
- The FCM push server returns the device token to user B.
- User B uploads the push certificate name and device token to the Agora Chat server.
- User A sends a message to User B.
- The Agora Chat server checks whether user B is online. If so, the server directly sends the message to user B.
- If user B is offline, the Agora server determines whether the user has configured FCM push.
- The Agora server sends the message to the FCM push server.
- The FCM push server sends the message to user B.
The device token is the push token provided by FCM push. That is, the registration token generated by the FCM SDK for the client app instance when your application is first launched. This token is used to identify every app on every device. FCM uses this token to clarify which device the message is sent to, and then forwards the message to the device. The device then notifies the app. You can call the FirebaseMessaging.getInstance().getToken() method to obtain the token. In addition, if you do not unbind the device token when logging out (pass false to the unbindToken parameter when calling logout), the user will still receive offline push notifications during the validity period of the push certificate and the token.
