Since at the moment CometChat uses topic based notifications, this will happen as the user needs to unsubscribe from the channel on being kicked which is not happening at your end.
For now, this can be handled in the below way:
- When you receive a real-time event for the user being kicked, you can check if the user that is kicked is the logged in user, you can unsubscribe to the push notification channel for the group from which the user was kicked from.
- When the push notification is received for user being kicked, again check if the user kicked is the logged in user, unsubscribe to the group channel.
This should make sure that the user does not receive push notifications on being kicked from any group.
This problem occurs as at the moment CometChat uses the topic based mechanism. We are in the process of migrating to token based mechanism. We have added your email to the list of subscribers for this feature request so that you are informed via email when we release this.
Hope this helps.