- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用push iOS 和 Android 版 meteor 应用程序中的通知。如果我向其发送通知的用户已连接到互联网,则效果很好。问题是,如果我向离线用户发送通知,并且当他在几个小时后连接到互联网时,通知不会发送。关于如何克服这个问题的任何见解。以下是我发送通知的代码:
Push.send({
from: '1234',
title: title,
text: text,
notId : nId,
gcm: {
title: title,
style: 'inbox',
},
query: {
userId: {
$in: userIds
},
}
});
最佳答案
我在您提供的 gitRepo 中找不到 TTL(生存时间)选项。通常有一个选项。您可以在此处阅读更多相关信息
concept options
更新
New Link
Lifetime of a message
When an app server posts a message to FCM and receives a message ID back, it does not mean that the message was already delivered to the device. Rather, it means that it was accepted for delivery. What happens to the message after it is accepted depends on many factors.In the best-case scenario, if the device is connected to FCM, the screen is on and there are no throttling restrictions, the message is delivered right away.
If the device is connected but in Doze, a low priority message is stored by FCM until the device is out of Doze. And that's where the
collapse_key
flag plays a role: if there is already a message with the same collapse key (and registration token) stored and waiting for delivery, the old message is discarded and the new message takes its place (that is, the old message is collapsed by the new one). However, if the collapse key is not set, both the new and old messages are stored for future delivery.If the device is not connected to FCM, the message is stored until a connection is established (again respecting the collapse key rules). When a connection is established, FCM delivers all pending messages to the device. If the device never gets connected again (for instance, if it was factory reset), the message eventually times out and is discarded from FCM storage. The default timeout is four weeks, unless the
time_to_live
flag is set.To get more insight into the delivery of a message:
- For Android and iOS: See the FCM reporting dashboard, which records the number of messages sent and opened on iOS and Android devices, along with data for "impressions" (notifications seen by users) for Android apps.
- For Android: If you'd like to be notified when the application successfully receives a message, you can use delivery_receipt_requested functionality following the guidelines. This requires you to setup an XMPP server.
- For Android, iOS and Web: You can use InstanceID APIs to check the most recent date that the device you're targeting through the FCM registration token has established a connection with FCM.
关于Meteor raix 推送通知因无连接而丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49644871/
我正在使用push iOS 和 Android 版 meteor 应用程序中的通知。如果我向其发送通知的用户已连接到互联网,则效果很好。问题是,如果我向离线用户发送通知,并且当他在几个小时后连接到互联
我正在尝试使用 raix(版本 2.6.1)从浏览器控制台发送推送通知。我尝试使用 this tutorial 中的 php 脚本进行推送它适用于我拥有的证书和 key ,但是当我使用 raix 尝试
我一直在使用 raix:push 包为 android 和 ios 发送推送通知。它一直运行良好,但在 android 8.0 上却不行。 显然,我们需要为 android 8 及更高版本的每种通知类
我是一名优秀的程序员,十分优秀!