【发布时间】:2015-05-22 15:54:44
【问题描述】:
我正在将我的 android 应用程序的推送通知系统从 Urban Airship 切换到 Azure。接收通知工作正常,但禁用通知不起作用。我的设置菜单中有一个按钮,可以切换用户是否收到推送通知。目前按钮调用的方法如下所示:
public static void setPushEnabled( Context context, boolean isEnabled) {
if( isEnabled ) {
NotificationsManager.handleNotifications(context, SENDER_ID, MyPushHandler.class);
} else {
NotificationsManager.stopHandlingNotifications(context);
}
}
在调用stopHandlingNotifications 后,应用仍会收到推送通知。然后,如果用户重新打开推送通知,handleNotifications 将再次被调用,并且用户会收到来自服务器的每一个通知 2 个通知。这是 NotificationsManager 的文档:http://dl.windowsazure.com/androiddocs/com/microsoft/windowsazure/notifications/NotificationsManager.html
我在这里遗漏了什么吗?有谁知道禁用 Azure 推送通知的其他方法?
【问题讨论】:
标签: android azure notifications push