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.