[英]How to disable push notifiaction when i logout from application in 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);
仍然我没有得到解决方案,但是作为快速修复,我在注销后使用boolean flag强制禁用了通知代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.