Guide Overview
This guide provides step-by-step instructions on migrating from the Push Notifications Extension to the Enhanced Push Notifications system.
1. Update the SDKs
To enable Enhanced Push Notifications, ensure that all relevant SDKs are updated according to the prerequisites.
2. Retrieve User Settings
Locate the code where CometChatUIKit.login()
or CometChat.login()
is used. Once the login is successful, fetch the user’s settings configured for the Push Notifications Extension. These settings need to be migrated to the new notification system using the SDK methods.
Use the table below to map the old settings to the new Enhanced Push Notifications settings:
Sr. No. | Old | New |
---|---|---|
1 | dnd | Mute preferences allows configuring DND. |
2 | chat.allow_only_mentions | Notify for messages & replies with mentions in one-on-one conversations and group conversations. |
3 | chat.mute_group_actions | Group preferences → Group actions. |
4 | chat.mute_all_guids | Group preferences → Don’t notify for any of the events. |
5 | chat.mute_all_uids | One-on-one preferences → Don’t notify for any of the events. |
6 | chat.muted_guids | Mute preferences allow muting group conversations. |
7 | chat.muted_uids | Mute preferences allow muting one-on-one conversations. |
10 | call.mute_all_guids | No funtionality to mute calls. |
11 | call.mute_all_uids | No funtionality to mute calls. |
12 | call.muted_guids | No funtionality to mute calls. |
13 | call.muted_uids | No funtionality to mute calls. |
Note: If your app doesn’t allow the users to configure preferences for Push Notifications, you can skip this step. Instead, configure the desired values from the CometChat dashboard → Notifications → Preferences section. These will be applied for all the users of your app. Or you can use the SDK methods or APIs to configure the same.
3. Delete the user’s old tokens
Once the user logs in successfully, delete all old tokens (all: true
) that were registered with the Push Notifications Extension to prevent delivery of notifications through Extension.
Note: If the user is logged in to multiple devices and some devices have not yet updated to the latest version of your app, push notifications will stop working on those devices until the update is installed. This is because we are deleting all the tokens registered with the Push Notifications extension to avoid duplicate notifications.
4. Implement the Enhanced Push Notifications in your app
Modify your app to integrate the Enhanced Push Notifications system. For example in case of android:
- Replace the old token registration method with the new token registration method.
- Replace the old token deletion method with the new unregister token method.
For a detailed guide, follow the integration steps. You can also refer to sample apps for implementation:
Sample App Links
5. Disable the Push Notifications extension
Once all the users have updated to the latest version of your app, disable the Push Notifications extension from the CometChat dashboard.