Home > front end >  Alternatives for cordova-push-plugin for foreground notifications on ios?
Alternatives for cordova-push-plugin for foreground notifications on ios?

Time:10-10

I have been using https://github.com/phonegap/phonegap-plugin-push (deprecated) and recently swapped to the more active fork https://github.com/havesource/cordova-plugin-push.

However i need my app to be able to receive notifications while in foreground. This works great on Android with the foreground variable but it does not work on iOS and there are several open issues about it on the plugin. Most people seem to do quick hacks where they add checks in "on("notification") for foreground and make their own popup in the app. This works but i want it to appear in the notification center with vibration according to the users setting like what happens on android with the "foreground" variable. so the question is.

Is there a plugin that works with cordova that does this? Or can i configure https://github.com/havesource/cordova-plugin-push to work in foreground with iOS devices?

CodePudding user response:

The alternative is to use piggy back on Firebase and use https://github.com/dpa99c/cordova-plugin-firebasex

The drawback is that the plugin is huge because it does handle the whole Firebase stack but it is reliable for push notifications.

  • Related