I want my app I build with Cordova and which runs on Android and ios to check my server for some data. I then want to use this data to update the badge at the phone homescreen. For this badge I use the plugin created by Katzer https://github.com/katzer/cordova-plugin-badge.
Now I believe the best way to achieve this is to generate an Ajax call to get the data from the server. Problem is that I want to do this specifically when the user is not actually using the app, preferably about once a day. Now I have found that it is possible to achieve this in the background using various plugins that create a background mode, but this is battery intensive and won't work if the user as stopped the app.
My question is what would be the best way to update my badge without the user having to open the app?