1
我已經註冊的設備從谷歌服務器和myServer,如果我手動註銷設備從谷歌服務器,但不是從myServer我不斷從myServer獲取通知。 我打電話GCMRegistrar.unregister(context);
和呼叫後去GCMIntentService進入方法GCM手動取消註冊從谷歌服務器不工作
@Override
protected void onUnregistered(Context context, String registrationId) {
Log.i(TAG, "Device unregistered");
if (GCMRegistrar.isRegisteredOnServer(context)) {
//ServerUtilities.customUnregister(context, registrationId);
} else {
// This callback results from the call to unregister made on
// ServerUtilities when the registration to the server failed.
Log.i(TAG, "Ignoring server unregister callback");
}
}
我讀過這developer.android how unRegistration works但它沒有明確的對我 爲什麼我總是收到通知? tnks迴應
如果我不在myServer上註冊,雖然我從Google服務器上刪除將繼續收到通知?不可能?如果是的話,我問自己爲什麼要打電話給GCMRegistrar.unregister(context)? – Scorpy86
yes.You should unregister from your server。完全取消註冊僅適用於第三臺服務器 – Yahor10
您可以從客戶端調用取消註冊事件 - 即GCMRegistrar.unregister(上下文)執行 – Yahor10