On('notification') not fired when app in foreground

I am using the phonegap-plugin-push plugin.

When the app running in background receiving a push, causes the notification to show in notification center on my iphone. Clicking it causes the app to open, and the push.on(‘notification’) handler code is run.

When the app is running in foreground the push.on(‘notification’) handler code is not run. The only thing i see in xcode log is didReceiveNotification with fetchCompletionHandler

Is there anyone who has seen the same thing, and knows any way to get the on(‘notification’) code to run also in foreground?

EDIT: It works as it should on Android, but not on iOS

Thanks in advance,
Lars

Hi Lars,

I’m seeing the same thing here too, did you find out the cause of this issue?

Graham

Hi Graham,
Sadly no. I decided to let it rest for a while, so i haven’t been looking much for a solution lately.

Lars

Hello Guys,
Remove your push plugin and install it again with @2.2.3. I hope this works for you.

I am already using the 2.2.3 version. I assume you meant 2.3.0?
I will test that version.
Thanks.

I’m still just getting the didReceiveNotification with fetchCompletionHandler when receiving push notifications when the app is in foreground. Did not help to upgrade to version 2.3.0 of the plugin. I also tried the 2.2.3, no go with that version either, sadly.

I was getting the same error but version 2.2.3 worked for me. My iOS platform is 5.0.0 try removing and adding it again.
Also my pod is => pod ‘FirebaseMessaging’, ‘~> 2.0.0’

Which iOS version are you on? Because @2.2.3 does not work on my iOS 13, because the device token is an object, instead of a string as expected. In version 2.3.0 this is fixed, but i still get the didReceiveNotification with fetchCompletionHandler message when the app is in foreground.

Sir are u fixed above issue actually I have got same issue in both Android and iOS?

No, I haven’t found a solution - but i only have the problem on iOS.

Hello
just tested the push notification on iOS 13.1.3 working perfect.
And my version is “2.2.3”
Platform is iOS 5.0.0

sir can you tell me how to fix above issue?