卸载应用后,我遇到自动取消注册的问题。我已经等了大约20个小时,但结果永远不会返回NotRegistered。我从文档中读到了有关GCM的所有主题。有没有我错过的东西?
修改
当我尝试通过代码取消注册时,它不起作用,消息仍然存在。我使用的代码用于取消注册。
public class MainActivity extends Activity {
GoogleCloudMessaging gcm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
gcm =GoogleCloudMessaging.getInstance(this);
unregisterInBackground();
}
private void unregisterInBackground() {
new AsyncTask<Object, Object, Object>() {
@Override
protected String doInBackground(Object... arg0) {
String msg = "";
try {
gcm.unregister();
msg = "Device was succesfully unregistered";
} catch (IOException ex) {
msg = "Error :" + ex.getMessage();
}
return msg;
}
}.execute(null, null, null);
}
}