[英]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.