【发布时间】:2012-09-04 10:32:16
【问题描述】:
我已经在我的应用程序中配置了 GCM。每当用户卸载应用程序时,我都想从 GCM 注销设备。
我得到的代码是
Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
unregIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
startService(unregIntent);
但是我们必须把这段代码放在哪里..?
谢谢。
【问题讨论】:
-
更多信息来自:how to unregister from GCM
-
谢谢。这是一个很棒的信息
-
更多信息请参见这个 SO 答案:stackoverflow.com/a/28057615/3913366。
标签: android google-cloud-messaging