Turn off notifications of an app programatically o

2019-01-20 09:20发布

I am developing a package manager application which shows checkboxes to turn off notifications from different applications installed on the Android device.

Turning off notifications of an app from Applications Manager

Since Android 4.1, users can turn off notifications of an app from application manager. Can I turn on/off notifications from an app programatically? Is there an API for doing that?

2条回答
ゆ 、 Hurt°
2楼-- · 2019-01-20 10:19

If you are App dev, you should manage that on server side, having a webservice (REST API) allowing the user to unsubscribe to the notifications. Then implement a Settings section in your App where user can uncheck a notification box and that call this service. Then, your server will not send the notification to this user.

查看更多
干净又极端
3楼-- · 2019-01-20 10:21

No, you cannot do that from your code. Perhaps on rooted devices you could do some magic, but that shall not really count for wider audience.

查看更多
登录 后发表回答