Push notification Android GCM推送通知每天都会显示

Push notification Android GCM推送通知每天都会显示,push-notification,google-cloud-messaging,Push Notification,Google Cloud Messaging,我们的应用程序中存在一个相当大的问题,它被设置为接收GCM推送通知:在不启动推送通知的情况下,应用程序会接收推送通知-这种情况每天都会发生 我已经实现了一个GCM客户机(显然还有服务器端),它几乎完全符合这里的规定 这是我的gcminentservice中的onHandleIntent函数: @Override protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtr

我们的应用程序中存在一个相当大的问题,它被设置为接收GCM推送通知:在不启动推送通知的情况下,应用程序会接收推送通知-这种情况每天都会发生

我已经实现了一个GCM客户机(显然还有服务器端),它几乎完全符合这里的规定

这是我的
gcminentservice
中的
onHandleIntent
函数:

    @Override
    protected void onHandleIntent(Intent intent) {
        Bundle extras = intent.getExtras();
        GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
        // The getMessageType() intent parameter must be the intent you received
        // in your BroadcastReceiver.
        String messageType = gcm.getMessageType(intent);

        if (!extras.isEmpty()) {  // has effect of unparcelling Bundle


            // If it's a regular GCM message (and the user is logged in), do some work.  
            if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType) && prefsMan.getLoggedIn(this)) {

            // Post notification of received message.
            sendNotification(extras.getString("message"));
            Log.i(TAG, "Received: " + extras.toString());
            }
        }
        // Release the wake lock provided by the WakefulBroadcastReceiver.
        GcmBroadcastReceiver.completeWakefulIntent(intent);
    }
是什么原因导致推送通知每天出现,而没有从服务器端启动?


顺便说一句,如果我今天能在这件事上悬赏的话,我会做的,所以请-任何帮助都会被感谢,我最终会把我的一些代表给任何能帮助我解决这个问题的人,只要我被允许这样做(两天后).

通知中显示了什么?因此我们启动了一个推送通知作为测试-类似于“感谢使用我们的应用程序!”。确切的文本每天都会显示为推送通知,即使它没有从服务器端触发。而且很难调试,因为我不确定通知何时启动(我想我现在会把它添加到消息中,就在我调用sendNotification之前)。此版本的应用程序仍处于测试阶段,因此它还不是一个火车撞车事件,但迫切需要修复它…您的服务器是否一直在运行,或者您是否有时在本地打开它?好的,我不能确定,但可能只是您的服务器在运行的任何地方都有问题。是否每天都会调用发送测试通知的功能以获取任何原因儿子?我用过gcm,我很确定gcm服务器不会自动生成消息。