Unfortunately, Google has made it (almost) impossible to wake up the phone via some external event without using its proprietary GCM. Even though GCM is not part of AOSP, it has unique status on the platform that can't easily be replicated (without recompiling the kernel, etc like the article mentions).
Before the days of doze mode & other battery optimizations, you could just listen & block on a socket, then let the phone go to sleep. Incoming 3G packets would wake up the phone, you grab a wakelock, then start doing things. From what I remember, at least a while ago Facebook Messenger did this using MQTT. But this is not possible any more.
The jar you include actually opens just an IPC channel to the Google Play Services framework, which runs with system permissions, and handles the actual stuff.
You can’t implement your own FCM without having root access on EVERY Android phone out there.
> Before the days of doze mode & other battery optimizations, you could just listen & block on a socket, then let the phone go to sleep. Incoming 3G packets would wake up the phone, you grab a wakelock, then start doing things. From what I remember, at least a while ago Facebook Messenger did this using MQTT. But this is not possible any more.
It's not a coincidence that the Facebook app was known for being an absolute battery killer. Go to any android forum post about battery life from a year or more ago and you'll see that the first suggestion is always "have you tried removing Facebook?"
That's very easy to manage.
Every random 15-60 minutes a gcm/firebase message containing an encrypted payload with "you got this mail/no mail for you sir".
So google cant get your frequency of use.
It's my impression that most people use Signal as an SMS app replacement, and in that environment people would not find a random 15-60 minute delay until their phone tells them about an incoming message to be tenable. I certainly wouldn't.
No. Apps can abuse waking up the phone all they want (and as much as user lets them), as long as they do it via Google's servers. What they can't do is bypass GCM/FCM. Nothing to do with UX.
Before the days of doze mode & other battery optimizations, you could just listen & block on a socket, then let the phone go to sleep. Incoming 3G packets would wake up the phone, you grab a wakelock, then start doing things. From what I remember, at least a while ago Facebook Messenger did this using MQTT. But this is not possible any more.