When i send a push notification to iOS, it only gets recieved, when the app is on background or killed.
If the app is in foreground, nothing happens at all.
On Android everything works just fine.
The strange thing is, that i have the same code running in other projects and there are no issues.
Another strange thing:
It seems like the onNotification-method is only triggered, when i recieve a notification with a killed app and tap on the notification.
Ok, i figured it out:
It looks like, there is an incompatibility between the native local-notification-plugin and, apparently, all available fcm-related plugins on recent ios versions
So, as soon as i install both, the fcm plugins stop working correctly.
cordova-plugin-fcm is still the best of all solutions, but, as i described, the app doesnt recognize push notifications in foreground, when the local notifications are installed as well.
I will raise another topic for detailed discussions on this topic.
Did you find a solution for foreground notifications on IOS? Iām trying to use the local notification plugin to schedule a notification when I receive it in foreground.
I use cordova-plugin-fcm-with-dependecy-updated 2.2.5 and I receive the notification. However, if you try to schedule LocalNotification that is not going to work on IOS in foreground mode. What I did is that I just receive the notification data and show a toast message on IOS instead of scheduling a local notification.
We cannot display the notifcation in notification bar when the app is running foreground.
We will have to toast the notfication data inside the app when running foreground.