简体   繁体   English

收到推送通知后,是否可以修改它?

[英]Is it possible to modify a push notification after it has been received?

For example, if I receive an @mention on a twitter app, I might get a notification like: 例如,如果我在Twitter应用程序上收到@mention,则可能会收到类似以下的通知:

    "You have 1 new mention"

If I receive another @mention before I opened the previous push notification, I'd like it to update to: 如果在打开上一个推送通知之前收到另一个@mention,我希望它更新为:

    "You have 2 new mentions"

rather than send another notification like the first and end up with: 而不是像第一个那样发送另一个通知并最终得到:

    "You have 1 new mention"
    "You have 1 new mention"

on the lock screen. 在锁定屏幕上。

I am probably saying the obvious but just to make things clear. 我可能说的很明显,但只是为了使事情变得清楚。

Notification has been sent and Notification has been received are two different states (Ambiguity in your question) 通知已发送通知已收到是两种不同的状态(您的问题中的歧义)

A sent notification hasn't been necessarily delivered to the user. 发送的通知不一定已传递给用户。 If new notification arrives on the APN server before the previous has been delivered, it will be discarded and only the newer one will be sent to the user. 如果新的通知在之前的通知到达之前已到达APN服务器,它将被丢弃,只有新的通知会发送给用户。

For situation like this, when new notification arrives on the APN server before the previous has been delivered you would need a mechanism of knowing the number of "unread" messages/mentions. 对于这种情况,当新的通知在APN服务器上传递之前到达APN服务器时,您将需要一种机制来了解“未读”消息/提及的数量。

A received notification is one that has been delivered to the device and depending on the state of the application (terminated/active/in background) you can react to it. 收到的通知是已发送到设备的通知,您可以根据应用程序的状态(终止/活动/在后台)对此做出反应。

There is no way of modifying once sent (and received) notification but you can obviously update the badge number for the application to show to the user the number of "unread" notifications. 无法修改一旦发送(和接收)的通知,但您显然可以为应用程序更新徽章编号,以向用户显示“未读”通知的数量。

Therefore I would suggest perhaps a better usability of the notification message. 因此,我建议通知消息的可用性可能更高。

  • Notification from whom 来自谁的通知
  • The actual mention message 实际提及讯息
  • etc. 等等

as the badge number is better used for the amount of new notifications. 因为徽章编号可更好地用于新通知的数量。

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

相关问题 用户在后台收到推送后手动打开应用程序时获取推送通知有效负载 - Getting push notification payload when user opens app manually after push has been received in the background 终止后,通过推送通知启动应用程序 - Launch an app with push notification after it has been terminated 如果应用已收到推送通知,请执 - Action if app has received push notification iOS-收到推送通知后显示视图 - iOS - Display view after push notification is received 是否可以在iOS上修改传入的推送通知文本 - Is it possible to modify incoming Push Notification Text on iOS iOS有什么方法可以在收到通知后修改推送通知警报消息? - iOS any way to modify push notification alert message once received? 在将应用提交到应用商店后添加iOS推送通知 - Add iOS push notification after app has been submitted to app store 删除并重新安装应用后,为推送通知权限重新生成iOS系统警报 - Regenerate iOS system alert for push notification permission AFTER app has been deleted and reinstalled 如何判断收到了哪些本地通知? 目标 - C. - How to tell which local notification has been received? Objective - C 收到通知但未点击或关闭通知时通知申请 - Notify application when a notification has been received and not tapped on or dismissed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM