如何从android中的应用程序注销时禁用推送通知

时间:2013-05-09 08:34:49

标签: android

我在登出按钮上使用以下代码点击请看看:

GCMRegistrar.unregister(mContext);

    Intent unregIntent = new Intent(
            "com.google.android.c2dm.intent.UNREGISTER");
    unregIntent.putExtra("app",
            PendingIntent.getBroadcast(mContext, 0, new Intent(), 0));
    unregIntent.putExtra("sender", Data.GCM_REGISTERED_ID);
    mContext.startService(unregIntent);

1 个答案:

答案 0 :(得分:2)

我仍然没有得到解决方案,但作为一个快速修复,我在使用布尔标志注销后强行禁用通知代码。