Handle push notification in the background

Hi. For push notifications that are sent by CometChat but we do not want to show, currently we handle it in the userNotificationCenter(_:willPresent:withCompletionHandler:) delegate method and pass completionHandler([]) if we do not want to show the notification. This is helpful for us when a push notification for a group message from a message sent by the current user is received in his/her own device. However, this does not work when the app is not in the foreground. Can you give any advice on this? I believe this issue has been reported in the Android SDK as well and the CC Android devs were able to resolve it. Please advise. Thanks.

Hello @jeraldo,

We have released v2 version of push notifications which is using token based approach using which there will be no notifications for self in group so that you don’t need to handle notification in background.

1 Like