有没有办法在推送徽章更新的同时保留以前的消息?
因此,想象一下这种情况:
10.00:您的应用程序推送消息“Hello”
10.01:您的应用程序推送徽章更新,但同一设备上没有消息
发生的情况是消息消失了。因此,如果用户没有看到它,它就消失了。有没有办法在不清除任何以前的消息的情况下发送徽章通知?我知道您可以再次发送该消息,但我不想向可能已经准备好该消息的用户发送垃圾邮件。
我不想讨论为什么,只是如果可能的话?
So imagine this scenario:
10.00: your app pushes a message "Hello"
10.01: your app pushes a badge update with no message out the same device
What happens is that the message dissappears. So if the user didn't see it, it's gone. Is there a way to send a badge notification without clearing any previous messages? I know you can send the message again, but I don't want to spam users who may have already ready the message.
I don't want to have a discussion about the why, simply if it's possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这是不可能的。我们建议将徽章更新包含在提醒中,以便同时进行设置,但无法仅更新徽章而不“覆盖”提醒。
但与此同时,来自任何其他应用程序的任何消息也将覆盖您之前的警报。
如果您在 APNS 负载中包含声音,手机将播放声音或振动,因此如果您最终需要这样做,您至少可以向用户提供已收到消息的反馈。
Unfortunately, it is not possible. We recommend including badge updates with your alerts, to set it at the same time, but there's no way to just update the badge without "overwriting" the alert.
At the same time, however, any message from any other application will also overwrite your earlier alert.
If you include a sound in your APNS payload, the phone will either play the sound or vibrate, so you could at least give the user feedback that a message has been received if you end up needing to do this.