Wednesday, December 4, 2019

applications - How do certain apps show new notifications when internet access is restricted to them?


I have disabled WhatsApp's access to Internet by disabling both WLAN-usage and mobile network usage.


I thought this should block WhatsApp from accessing the internet. But miraculously WhatsApp gives me a message with ominous content: "You might have new messages"


When I open WA it does not show any messages. When I then give it back it's access rights wonder what, there are messages I received the same day!


So to me it looks as if this app has found its way to sneak around my network restrictions.


So the following questions arise:




  • Is my assumption about the effectiveness of restricting the "data usage" for apps wrong?

  • Does WhatsApp hack around the standard restrictions?



Answer



App developers can tell better but what I perceive is that many modern apps use Firebase Cloud Messaging - a proprietary service from Google, not part of AOSP - for push notifications. In fact developers are forced to use Google's proprietary products unnoticeably. Quoted from here:



The Doze restriction on network access is also likely to affect your app, especially if the app relies on real-time messages such as tickles or notifications. If your app requires a persistent connection to the network to receive messages, you should use Firebase Cloud Messaging (FCM) if possible.
...
FCM is optimized to work with Doze and App Standby idle modes by means of high-priority FCM messages.




FCM is a part of Google Play Services (1):



FCM SDK's only hard dependency is Google Play Services



Play Services is a set of apps which are injected to Android devices with highly privileged permissions, so they aren't subject to data/battery restrictions.


Since you have blocked only the app and not Play Services, app may receive push notifications (though the actual data may not be delivered to the app).


So block GMS in order to block push notifications. Or choose the apps which aren't fond of Google.


RELATED: What is the exact functionality of Google Play Services & Services Framework?


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...