Warn user if Google Services' Restrict background data option is activated

喜欢而已 提交于 2019-12-12 14:31:42

问题


On android 5, and possibly earlier, if a user goes to his "Data usage" settings, and enables an option called "Restrict background data" for his "Google Services" app, he will no longer receive push notifications while on his mobile network.

Users get told to do that by random websites for security/mobile data/battery reasons, and they forget about it.

We would like to be able to warn user that it is this option is causing them to not reliably receive push notifications, is there any way to programmatically detect it's status?

I have seen this code on google, https://github.com/WhisperSystems/Signal-Android/issues/970#issuecomment-37113943

but

  • getNetworkActivityInfo doesn't exist (anymore)

  • Using anything else will always indicate that the network is available and connected, even if said Google services is turned on.

来源:https://stackoverflow.com/questions/36020733/warn-user-if-google-services-restrict-background-data-option-is-activated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!