cordova-plugin-fcm-with-dependecy-updated icon indicating copy to clipboard operation
cordova-plugin-fcm-with-dependecy-updated copied to clipboard

iOS notification appear when app is in foreground

Open RidClick opened this issue 5 years ago • 5 comments

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.

RidClick avatar Nov 25 '20 20:11 RidClick

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

inspire22 avatar Dec 10 '20 22:12 inspire22

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.

RidClick avatar Jan 11 '21 10:01 RidClick

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.

RidClick avatar Feb 03 '21 13:02 RidClick

You are right @RidClick. The plugin doesn't present anything, it only receives and gives it to the JS context.

andrehtissot avatar Feb 03 '21 20:02 andrehtissot

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.

RidClick avatar Feb 04 '21 09:02 RidClick