Search code examples
androidioscordovafirebase-cloud-messagingnativescript

Is FCM still better than polling when updating every 10 min is ok?


I want to have some sort of notification system for a mobile app with cordova/nativescript and using FCM seems like a lot of trouble for a little thing. I mean this is a private app, I don't want to publish it, just use it for my own purposes and I don't really want to buy a domain name and register for example a let's encrypt cert and renew it each month. All I need is sending a HTTP GET with an if-modified-since header every 10 mins to a certain IP and trigger an alert when there is a new event even at night. Is this a viable solution or would android/ios kill the application after a while? Would it completely drain the battery overnight?


Solution

  • If the app is always going to be active, you can implement your own polling mechanism.

    If the app also needs to receive and display notifications when the user is not actively using it, there is no way to keep your own polling code running. In those scenarios FCM (Android+iOS+Web) or APNS (iOS only) are your only options.