【发布时间】:2016-06-01 13:14:04
【问题描述】:
我正在使用 Google Cloud Messaging 将新订单接收到应用程序中。我正在尝试处理相同订单被发送两次的情况。我只想忽略第二张收据,不幸的是,当应用程序在后台时,我似乎无法取消通知(即它仍然会发出噪音并发送消息)。该应用程序在前台运行良好,将取消通知代码放在我的 GCMBrodacastreceiver 中似乎没有做任何事情。我错过了什么吗?
NotificationManager mNotify = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotify.cancelAll();
【问题讨论】:
标签: android push-notification notifications google-cloud-messaging