You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KMPNotifier and Kotlin version:
kmpnotifier version: 1.4.0, kotlin version: 2.1.0
Describe the issue
I have an app where I want to remove/not display certain push notifications when the user is on a specific screen.
A good example for this use case is a chat app. When the user has the chat screen open with a certain person you want to silence the incoming push notifications from that chat.
If I let the KMPNotifier library show the push notifications automatically (which is great) then I do not know which notifications to remove because I can only remove notifications based on an Integer id which is randomized under the hood. I also do not want to remove all notifications.
Would it be possible to remove notifications based on the payload data?
Or get/set the IDs somehow to be able to keep track of them?
As a workaround currently I am trying to disable the automatic showing of the notifications and show the notifications manually so I can keep track of them. However this runs into issues again because I have two separate methods to work with:
onPushNotification and the onPayloadData
The onPushNotification only has the title and the body parameters within that I cannot call NotifierManager.getLocalNotifier().notify because I do not have the payload data received from the server and I want the payload data in the notification so I can get it back in the onNotificationClicked method.
And in the onPayloadData function I do not have the title and body of the notification.
I can think of several ugly workarounds to resolve this but I wanted to bring up this topic because maybe I am missing some obvious easy solution here. I am an Android dev first and there we receive the notification details next to the payload data in one method but I guess this is not the case on iOS.
Anyway do you have any suggestion on how to implement such functionality with this library?
Thanks in advance for the answer.
In which platform bug occurs?
android, ios
The text was updated successfully, but these errors were encountered:
I actually totally agree with you, currently it will be kinda ugly workaround since onPushNotification and onPayloadData are in two different methods. I'll check this again, and if possible provide them in one listener function
KMPNotifier and Kotlin version:
kmpnotifier version: 1.4.0, kotlin version: 2.1.0
Describe the issue
I have an app where I want to remove/not display certain push notifications when the user is on a specific screen.
A good example for this use case is a chat app. When the user has the chat screen open with a certain person you want to silence the incoming push notifications from that chat.
If I let the KMPNotifier library show the push notifications automatically (which is great) then I do not know which notifications to remove because I can only remove notifications based on an Integer id which is randomized under the hood. I also do not want to remove all notifications.
Would it be possible to remove notifications based on the payload data?
Or get/set the IDs somehow to be able to keep track of them?
As a workaround currently I am trying to disable the automatic showing of the notifications and show the notifications manually so I can keep track of them. However this runs into issues again because I have two separate methods to work with:
onPushNotification and the onPayloadData
The onPushNotification only has the title and the body parameters within that I cannot call NotifierManager.getLocalNotifier().notify because I do not have the payload data received from the server and I want the payload data in the notification so I can get it back in the onNotificationClicked method.
And in the onPayloadData function I do not have the title and body of the notification.
I can think of several ugly workarounds to resolve this but I wanted to bring up this topic because maybe I am missing some obvious easy solution here. I am an Android dev first and there we receive the notification details next to the payload data in one method but I guess this is not the case on iOS.
Anyway do you have any suggestion on how to implement such functionality with this library?
Thanks in advance for the answer.
In which platform bug occurs?
android, ios
The text was updated successfully, but these errors were encountered: