简体   繁体   English

Android系统会阻止FCM通知吗

[英]Does android system blocks FCM notification

I am sending a data notification every 2 min for the device in order to collect data (GPS, Signal strength ...). 我每2分钟发送一次设备数据通知,以收集数据(GPS,信号强度...)。

The FCM trigger service that sends the collected data to an API 将收集的数据发送到API的FCM触发服务

However, The device stops receive FCM notification to starts that app in some cases or even till restart it. 但是,在某些情况下,设备会停止接收FCM通知以启动该应用程序,甚至直到重新启动它为止。

Is there any reason for this and how Can I pass it? 有什么原因,我该如何通过?

Note: I have Add server up to white list in the firebase console 注意:我在Firebase控制台中将服务器添加到白名单

Generally there are two types of FCM messages we can send to registered devices. 通常,我们可以将两种类型的FCM消息发送到已注册的设备。 First one is data message and the other one is notification message. 第一个是数据消息,另一个是通知消息。 The default priority of data message is NORMAL where as the notification messages have a HIGH priority. 数据消息的默认优先级为NORMAL ,其中通知消息的优先级为HIGH Messages with HIGH priority are considered to be delivered first (That means there is a chance of not receiving data messages in some case). 具有高优先级的消息被认为是首先发送的(这意味着在某些情况下有可能不接收数据消息)。 But it is possible to change the priority of data message to HIGH while sending them from server. 但是,从服务器发送数据消息时,可以将数据消息的优先级更改为HIGH。 https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message

But in my case i had some situations when i was not able to receive FCM messages even after setting priority to HIGH. 但是就我而言,即使将优先级设置为“高”,我也无法接收FCM消息。 Thus i opted to use FCM wrapper services like Onesignal to send push notification. 因此,我选择使用像Onesignal这样的FCM包装器服务来发送推送通知。 It is way better in case of message delivery. 如果是邮件传递,那就更好了。 Inside it is FCM, but they handled the message delivery problem up to an extent. 内部是FCM,但他们在一定程度上处理了消息传递问题。 Take a look at https://onesignal.com/ 看看https://onesignal.com/

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

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