回滚/取消的android-GCM通知 [英] rollback/cancel the android-gcm notification

查看:300
本文介绍了回滚/取消的android-GCM通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来回滚放置GCM服务器的通知要求?

Is there a way to rollback the notification request placed to GCM server?

作为,考虑GCM消息请求被放置到GCM服务器。 如果用户看到的Web邮件中移动网上来之前,在GCM请求应被回滚。而且用户不能看到手机的通知。

As in, consider a GCM-message-request is placed to GCM server. If the user sees the message in web before coming online in mobile, the GCM request should be rolled back. And user should not see the notification in mobile.

推荐答案

有没有这样的回滚在您所描述的情况下,建机制。你可以尝试自己实现它 - 当你的服务器注意到该消息是在网上看的,你可以发送另一个GCM消息到设备与重新presents需要回滚一些数据。当您处理该消息时,应清除该设备上创建您的应用程序的任何通知(我不知道如果可能的话,你就必须检查)。

There is no built in mechanism for such rollback in the case you describe. You can try implementing it yourself - when your server notices the message was viewed in web, you can send another GCM message to the device with some data that represents a need to rollback. When you process that message, you should clear any notifications that were created by your app on that device (I'm not sure if that's possible, you'll have to check).

有一个类似的情况下,这种机制 - 如果用户有多个Android设备,并且您发送GCM消息给所有的人(使用新的用户功能),一旦用户观看通知一台设备上的通知,将它自动从其它设备除去。

There is such a mechanism in a similar case - if the user has multiple Android devices, and you send a GCM message to all of them (using the new user notifications feature), once the user views the notification on one device, it would be automatically removed from the other devices.

      
  • 如果消息已被一台设备上进行处理,对其他设备的GCM消息被解雇。例如,如果一个用户已经处理的日历通知一台设备上,该通知会消失在用户的其它设备。
  •   
  • 如果消息尚未交付还没有一个设备,但它已被处理,在GCM服务器从队列中未发送的其他设备中删除。
  •   

这篇关于回滚/取消的android-GCM通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆