Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.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 应用程序处于后台时PushPlugin出错_Android_Cordova_Notifications_Push Notification_Phonegap Pushplugin - Fatal编程技术网

Android 应用程序处于后台时PushPlugin出错

Android 应用程序处于后台时PushPlugin出错,android,cordova,notifications,push-notification,phonegap-pushplugin,Android,Cordova,Notifications,Push Notification,Phonegap Pushplugin,我正在尝试实现一个使用Cordava 3.3创建的推送通知应用程序,使用以下内容:;让我以本教程为基础:www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql 但我有两个基本问题:第一个是,如果应用程序在后台或关闭,通知不会导致;第二个是,当应用程序在前台打开时,消息到达未定义状态,这可能会有所帮助,因为我正在阅读,这可能是由于JSON响应的格式或

我正在尝试实现一个使用Cordava 3.3创建的推送通知应用程序,使用以下内容:;让我以本教程为基础:www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql 但我有两个基本问题:第一个是,如果应用程序在后台或关闭,通知不会导致;第二个是,当应用程序在前台打开时,消息到达未定义状态,这可能会有所帮助,因为我正在阅读,这可能是由于JSON响应的格式或以相同方式发送的参数造成的

这是我的代码,不会花很长时间:

我实现了一个解决方案,下一条指令是第80行附近的插件“gcminentservice.java”

else {
    extras.putBoolean("foreground", false);

            // Send a notification if there is a message
            if (extras.getString("message") != null && extras.getString("message").length() != 0) {
                createNotification(context, extras);
            }
        }
发现您可以更改所需的“价格”,例如更改“消息”的“价格”,并且所有问题都已解决milagorsamente,请解释:

我们有: . 1$message=数组(“剥夺”=>$message)

当我读到它时读到: 1.消息

给我们的是未定义的,因为payload.price

从这个意义上讲,我们必须在JAVA插件中归档

if(extras.getString(“message”)!=null和&extras.getString(“message”).length()!=0){ createNotification(上下文、选项); }


如果因为它是以“价格”而不是“消息”的形式出现而无法运行。当我将SEND_MESSAGE.PHP的“price”更改为“MESSAGE”时,一切都解决了。因此,甚至不需要修改JAVA。

如何解决这个问题?我也一样,