onNotificationClicked not working on iOS
NotifierManager.addListener(object : NotifierManager.Listener { override fun onNotificationClicked(data: PayloadData) { super.onNotificationClicked(data) println("Notification clicked, Notification payloadData: $data") } }) is never called/printed on iOS
Where do you set the listener? It is recommended to set the listener at application startup. Can you please provide reproducible steps for that? I can't reproduce this in the sample application.
Also, can you please check again with version 1.5.0 of KMPNotifier and see if the issue still exists?
Please, check this comment as well: https://github.com/mirzemehdi/KMPNotifier/issues/84#issuecomment-2727061185
Sorry for a late replay, I set the listener in my ViewModel of the App composable, before I load other composable screens. Also I don't think that should be the issue, because on Android it works fine. I'll test it with 1.5.0 version and I'll post the reproduction steps if the issue still occurs.
I'm having the same issue and I'm using version 1.5.0
Me too
Yeah, same here on 1.5.1 :(
The listener was setup in the app init as instructed in the docs. onPayloadData is triggered correctly and i can assemble the banner but when clicking, onNotificationClicked is never called.
Here's my config in case it helps:
actual fun onApplicationStartPlatformSpecific() {
NotifierManager.initialize(
NotificationPlatformConfiguration.Ios(
showPushNotification = true,
askNotificationPermissionOnStart = false
)
)
}
When the iOS app is in killed state and when i tap on a notification, the app launches but fails to navigate to the intended screen. using version 1.5.1