0

I am developing an open source Android app that has push notifications.

If I understand https://developer.android.com/about/versions/oreo/background#services correctly, Android 8 forces me to use Firebase, or otherwise tells the user that my app is misbehaved.

Problem: The Firebase Android client library is not open source.

How to make sense of this situation?
Any solution for all open source developers like me? I want to keep push notification features in Android 8 while also remaining 100% open source and not being stigmatized as misbehaved.

Push notifications are needed by all messaging apps, for instance. Telegram-FOSS recently raised this problem.

Related but different: What firebase license should I include in my app?

2
+100

Ah, this explains much. I've recently taken to using riot.im for E2E-encrypted instant messaging on my Android phone. It's aggressively open source (they have an F-Droid link on their front page), and also under fairly intensive and well-funded development.

However, it persists in showing a notification at the top of my screen, and from time to time insists on warning me about battery consumption. I wasn't too worried, but the Telegram document you link to explains all:

Since one can't use Google's push messaging in a FOSS app, Telegram-FOSS has to show you a notification to keep the background service running. Otherwise, you wouldn't be notified about new messages.

Sadly, if the app would set the notification to lower priority (to hide it a bit in the lower part of the notification screen), you would immediately get a system notification about Telegram "using battery", which is confusing and is the reason for this not being the default.

So I conclude that, at least for the moment, free-software people are just not using Google's push messaging. Maybe Google will relax on Firebase licensing, maybe they'll change the rules about background apps, maybe the free-software community (I run Lineage OS) will get fed up and fix Android themselves. But currently, short of guiding your users to lower the priority of the resulting notification, and likewise the the battery warning that results from that, I don't think anyone has a workaround.

  • 1
    Thanks! Did someone report this issue to Google? If there is an issue logged somewhere I want to upvote it and subscribe to it. – Nicolas Raoul Jun 7 at 10:43
  • I don't know - you could ask the Telegram guys - but in any case I'm not sure Google would view it as a bug. – MadHatter supports Monica Jun 7 at 10:51
  • 1
    Then it would be a major problem for us open source community, and a case of Google using its de-factor Android monopoly to strongly disadvantage alternatives to its proprietary product :-/ – Nicolas Raoul Jun 7 at 11:59
  • Having read a little more about it, it seems that use of push messaging requires installation of Google Play Services; even if Google were prepared to open that up, lots of free Android users wouldn't be happy to install it. So I don't think this circle can be squared, at least not until Google completely rearchitects the way Android handles push messaging. – MadHatter supports Monica Jun 7 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.