且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在设置中禁用推送通知后,推送通知会传递到android手机吗?

更新时间:2023-02-27 09:24:13


在Android中,如果我们使用操作系统设置禁用了应用程序通知,
仍将fcm / gcm传递给设备吗?

In Android, if we disable app notifications using the OS settings, will fcm/gcm still deliver the notification to the device?

是,


如果将通知发送到设备,通知会传递到应用程序
上吗?还是操作系统阻止了它?

If it is delivered to the device will the notification be passed onto the app? or does the OS block it?

是,


device_token是否无效?

Is the device_token invalidated?

否。

就FCM / GCM / etc而言,推送通知与 App通知是不同的概念。

"Push Notifications", in terms of FCM/GCM/etc, are a different concept from "App Notifications".

系统设置中的通知屏幕仅显示允许或禁止使用什么应用程序使用 NotificationManager 在系统托盘中弹出通知。在系统进程的 NotificationManager 级别被阻止,并且未与应用程序通信。可以将推送通知视为一种简单的网络通信形式,而与是否允许该应用在托盘中显示通知无关。

The "Notifications" screen in System Settings is only about what apps are, or are not, allowed to use NotificationManager to pop up notifications in the system tray. That's blocked at the NotificationManager level in the system process, and isn't communicated to the application. Push Notifications can be thought of as simply a specific form of network communication, and that is not tied to whether or not the app is allowed to display a notification in the tray.

GCM仍将通过网络通信并向应用程序传递推送消息,操作系统不会阻止它( OS ,又名Android的 system_server ,本身实际上并不参与GCM),并且您应用的 device_token 不会失效。

GCM will still communicate over the network and deliver push messages to the application, the OS will not block it (the OS, aka Android's system_server, itself actually doesn't get involved in GCM), and your app's device_token will not be invalidated.