Ionic push notification issue ios + android

Hi,
Initially I was using @cometchat-pro/chat": “^1.8.6” for ionic and I subscribed to notifications for android using

  • topic: string = this.appId + “" + this.userType + "” + this.UID;
    and calling this -
    https://ext-push-notifications.cometchat.com/fcmtokens/’ + this.FCMToken + ‘/topics/’ + Topic, { “appId”: appID }
    Similarly for iOS I was using this topic -
  • topic: string = this.appId + “" + this.userType + "” + this.UID+"_ios"
    And calling the same URL

I got notifications on iOS and Android.
But since I have migrated to v2 of Cometchat pro, I am not able to receive any notifications on either on Android or iOS.

The error says - “appid” is invalid but I have verified my app id to the cometchat. It is the correct one.

1 Like

Hello @neeraj ,

It seems that there has been some misunderstanding with regard to the endpoint for subscribing to push notifications. The push notification flow has changed since v2. I am sharing the link to the documentation below.

Documentation: https://prodocs.cometchat.com/docs/cordova-ionic-extensions-push-notification

Please follow the steps mentioned in the documentation and let us know if you were successful in integrating push notification in your app. And if you face any difficulties or have any doubt while integrating Push Notification, please post your queries here and we will be more than happy to help you out.

1 Like

Will try this implementation. But what about the iOS? V.18 had “_ios” string added as a part of the parameter.
Where does the “_ios” parameter get added in this v2 docs for iOS push notification subscription

Hello @neeraj,

This will be handled internally at our end and you do not have to worry about sending _ios to subscribe to Push Notification.

1 Like

I have used “_ios” and it works on iOS. I get notification.
Although when I click on the notification, I redirect it to my chat thread page, tap on the thread to open the message, read it and then i navigate back to the chat thread page, the message still shows unread instead of read.

1 Like

Hello @neeraj,

It seems that your issue related to push notification has been resolved. I request you to create a new post for other issues. It will help us in organizing queries and solutions for other forum users.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.