0
我将Android应用程序的推送通知系统从Urban Airship切换到Azure。接收通知工作正常,但禁用通知不起作用。我的设置菜单中有一个按钮,可以切换用户是否收到推送通知。目前,该按钮调用该方法是这样的:Azure禁用推送通知android
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推送通知?