Hacker News new | ask | show | jobs
by mflare 2497 days ago
Although it is possible to distribute Android apps through other channels, you should not forget that for some applications you are still bound to Google. Due to the changes in Android Oreo regarding background services, you need Firebase Cloud Messaging (FCM) for a Messenger or other communication app to get the device out of Doze mode and to deliver push notifications without delay. If Google closes your account, you can still distribute the app through other stores, but FCM won't work anymore and there's no replacement for it.
1 comments

Oreo allows you to add an app to a Doze whitelist even if it is distributed outside the Play Store. In fact, it is easier that way because the Play Store review policy restricts why an app can ask for that.
Yes, this Doze whitelist has existed since Marshmallow, when Doze was introduced. However, adding your app to this list does not affect the limitations of background services implemented with Oreo.

If you want to implement your own push notifications, you need some kind of persistent connection to your server. Before Oreo, this was simply possible with a background service.

But starting from Oreo, your background services are shut down after 2 or 3 minutes, as soon as the corresponding app is no longer in the foreground. Of course, you could try to use a foreground service (which must display a notification). But even then the user gets a constant warning displayed like "App xyz is running in the background" or "App xyz is using battery".

Many users are not developers. If they get such a warning, they think something is wrong with your app. This is just not a good user experience. You are virtually forced to use FCM. And that doesn't work without a Google account.

Background Services have always been killed on short notice. AFAIK, the OS regularly restarts them, even if it is completely idle with zero memory pressure. It used to be that way in KitKat and prior versions too. Using a Foreground Service have always been a hard requirement for persistent network connection — unless you were ok with reestablishing the connection every hour.

"App xyz is running in the background" or "App xyz is using battery" aren't normally shown when you foreground Notification is properly constructed. If you correctly set icon, text, notification channel and other properties, the notification bar should have only your notification and nothing else. At least it have always worked that way on devices I own.