gpt4 book ai didi

android - GCM 从谷歌服务器手动注销不起作用

转载 作者:行者123 更新时间:2023-11-30 03:40:46 27 4
gpt4 key购买 nike

我有一个从谷歌服务器和我的服务器注册的设备,如果我手动从谷歌服务器而不是从我的服务器注销设备,我会不断收到来 self 的服务器的通知。我调用 GCMRegistrar.unregister(context);并在调用后转到 GCMIntentService 方法

@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

最佳答案

取消注册 gcm 事件后,您应该在您的第三个服务器端应用程序中取消注册。

 protected void onUnregistered(Context context, String registrationId) {
Log.i(TAG, "Device unregistered");
if (GCMRegistrar.isRegisteredOnServer(context)) {
ServerUtilities.customUnregister(context, registrationId); // here 3rd server side unregister
} 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");
}
}

关于android - GCM 从谷歌服务器手动注销不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15789304/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com