简体   繁体   English

在Android中禁用通知

[英]Disable notifications in Android

I have a live streaming app where you can be recording for hours and when the user receives a text message or a phone call, the vibration is trnaslated into sound and rippling video on the streaming. 我有一个实时流应用程序,您可以在其中记录数小时,并且当用户收到短信或电话时,振动会在流上转化为声音和波纹视频。

Is it possible to somehow programmatically disable all notifications or do I have to ask the user to do so by himself? 是否可以通过编程方式禁用所有通知,还是我必须要求用户自己禁用它?

You cannot control notifications from other apps. 您无法控制来自其他应用程序的通知。 There is indeed a solution for rooted devices . 对于有根设备,确实存在解决方案

'Standards' part in this guide says: 本指南中的 “标准”部分说:

One of the unfortunate problems Android users face is that there is no centralized control for how notifications work. Android用户面临的不幸问题之一是,没有集中控制通知的工作方式。 This means that if there is an application prompting you with a notification, short of uninstalling the application, there isn't much you can do. 这意味着,如果有一个应用程序提示您进行通知,那么只需卸载该应用程序,您将无能为力。 Starting in Android 4.1, users received a buried binary setting to 'Turn off notifications' for a specific app. 从Android 4.1开始,用户收到了针对特定应用的“关闭通知”的隐藏二进制设置。

No, unfortunately not. 不,不幸的是没有。 Perhaps on rooted devices, but ¯_(ツ)_/¯. 也许在有根设备上,但是__(ツ)_ /¯。 Best way seems to navigate the user to the related setting to disable all notifications, as you have also mentioned. 正如您已经提到的,最好的方法似乎是将用户导航到相关设置以禁用所有通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM