cordova-plugin-fcm-with-dependecy-updated
cordova-plugin-fcm-with-dependecy-updated copied to clipboard
iOS notification appear when app is in foreground
I don't know if it's a problem with the plugin or the way I send the notification, or if I'm missing a parameter. But notifications on iOS appear when the app is in the foreground and background. I would like them not to appear in the foreground.
Any suggestion?
Thanks in advance.
Did you get this figured out at all? This medium guide for this project implies it's supposed to be automatically silent while it is in the foreground.. https://medium.com/enappd/firebase-push-notifications-in-ionic-apps-d90c6550fdb7
Sorry for being late but I have not been able to make the notifications not show in background and foreground at the same time on iOS. As soon as I can solve it I will post it here.
After researching for a couple of days I have found that my problem is that the APNs alert is always sent, it does not matter if I add the content-available property that is supposed to prevent the alert from being sent.
I still don't know if my problem is with the plugin or the Firebase Admin SDK which is the one I'm using to send notifications. I am going to do a last test with the postman and the official url of the firebase but in advance I have sent a notification from the firebase itself to iOS and indeed, although the app is in foreground, the push notification is displayed and the APNs alert arrives.
I am more and more sure that the plugin is not controlling in iOS that the push notification does not show if it is already in the foreground.
I appreciate any suggestions.
You are right @RidClick. The plugin doesn't present anything, it only receives and gives it to the JS context.
It would be nice if you could add something to control it, since in my case I use a chat application with this plugin, on Android I have no problem but you imagine how it is a chat on iOS with all the notifications arriving while the app is open.