Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.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
Cordova 了解应用程序处于后台时是否收到通知_Cordova_Phonegap Pushplugin - Fatal编程技术网

Cordova 了解应用程序处于后台时是否收到通知

Cordova 了解应用程序处于后台时是否收到通知,cordova,phonegap-pushplugin,Cordova,Phonegap Pushplugin,当我把我的cordova应用程序带到前台时,我想检查应用程序在后台时是否收到通知是否有方法捕获挂起的通知?有人知道如何实现这一点吗 我从以下内容开始,但它不起作用: document.addEventListener("resume", resume, false); function resume(){ var pushNotification = window.plugins.pushNotification; pushNotification.getPendingNoti

当我把我的cordova应用程序带到前台时,我想检查应用程序在后台时是否收到通知是否有方法捕获挂起的通知?有人知道如何实现这一点吗

我从以下内容开始,但它不起作用:

document.addEventListener("resume", resume, false);

function resume(){
    var pushNotification = window.plugins.pushNotification;
    pushNotification.getPendingNotifications(function(notifications) {
            alert(JSON.stringify(notifications));
    });
};
我使用这个插件:并且显示通知是有效的。

我认为没有
getPendingNotifications
。默认的插件行为是,如果它在后台收到通知,它将在状态栏中创建一个通知。如果用户单击通知,当消息到达前台时,应用程序将收到该消息