I am using phonegap-plugin-push on Cordova and some app users get push notifications every ~30 seconds. The problem is when their device is OFFLINE and they go online say 1 hour later, they are suddenly flooded with 120 push messages at once, crashing and freezing the app.

I have a webapp using Faye for push notifications. I've packaged that web app inside a cordova android app and runs fine, and I'm using Faye.js client to listen for notifications.

The problem is that, when the application is not running in the background, notificatons are not being listened.

I've used intents in the past (a very long time ago) for an Android native app to listen for notifications but I don't know which is the "Cordova" way to do this. I would also like this to be compatible with iOS.