简体   繁体   中英

Alternatives for cordova-push-plugin for foreground notifications on ios?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM