Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android GCM从google服务器手动注销无效_Android_Push Notification_Google Cloud Messaging - Fatal编程技术网

Android GCM从google服务器手动注销无效

Android GCM从google服务器手动注销无效,android,push-notification,google-cloud-messaging,Android,Push Notification,Google Cloud Messaging,我已经从Google server和myServer注册了一个设备,如果我手动从Google server(而不是myServer)注销该设备,我会一直收到来自myServer的通知。 我调用gcmregistar.unregister(上下文) 调用之后,转到方法中的gcminentservice @Override protected void onUnregistered(Context context, String registrationId) { Log.i

我已经从Google server和myServer注册了一个设备,如果我手动从Google server(而不是myServer)注销该设备,我会一直收到来自myServer的通知。 我调用
gcmregistar.unregister(上下文)
调用之后,转到方法中的gcminentservice

@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");
        }
    }
我读过,但我不清楚 为什么我总是收到通知?
取消注册gcm事件后,响应的TNK应在第三服务器端应用程序中取消注册

 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");
        }
    }

注销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");
        }
    }

如果我没有在myServer上注册,虽然我从Google服务器上删除了,会继续收到通知吗?没有办法?如果是这样的话,我会问自己为什么要调用gcmregistar.unregister(上下文)?是的。你应该从服务器上注销。完全注销仅适用于从客户端调用unregister事件的第三台服务器,即gcmregistar.unregister(context)dotnks,其功能与卸载时相同,但在这种情况下,即使对服务器的调用出错,它也能管理!我等了大约50分钟,再也没有收到来自谷歌的通知,也没有向myServer发出取消通知,在我的服务器上,当我试图发送一条谷歌回复为“NotRegistered”的消息时。如果出现巧合,我会再试一次如果我没有在myServer上注册,虽然我从Google服务器上删除了,但会继续收到通知吗?没有办法?如果是这样的话,我会问自己为什么要调用gcmregistar.unregister(上下文)?是的。你应该从服务器上注销。完全注销仅适用于从客户端调用unregister事件的第三台服务器,即gcmregistar.unregister(context)dotnks,其功能与卸载时相同,但在这种情况下,即使对服务器的调用出错,它也能管理!我等了大约50分钟,再也没有收到来自谷歌的通知,也没有向myServer发出取消通知,在我的服务器上,当我试图发送一条谷歌回复为“NotRegistered”的消息时。如果有巧合,我会再试一次