简体   繁体   中英

How to keep the app in the background after closing - PhoneGap

I would keep my PhoneGap application in background after closing it in order to generate notifications.

I wish my application available on iOS , Android and Windows Phone with notifications.

Is it possible to execute the JavaScript when the application is in the background ? How to do ?

On iOS there are two kinds of notifications - remote notifications and local notifications. Remote notifications are delivered by your webservice through APNS and require for the device to be connected to the internet.

Local notifications on the other hand are scheduled on device. The most important thing is that both will wake your app for a short time, so it can consume the notification and decide what to do with it. During this time you can of course schedule another local notification.

This - https://github.com/katzer/cordova-plugin-local-notifications - seems like a good place to start investigating.

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