簡體   English   中英

當我從android中的應用程序注銷時如何禁用推送通知

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM