当我将我的科尔多瓦应用程序带到前台时,我想检查是否收到通知,而该应用程序在后台。有没有办法捕获待处理的通知?有谁知道如何实现这一目标?
我从以下开始,但它不起作用:
document.addEventListener("resume", resume, false);
function resume(){
var pushNotification = window.plugins.pushNotification;
pushNotification.getPendingNotifications(function(notifications) {
alert(JSON.stringify(notifications));
});
};
我使用这个插件:https ://github.com/phonegap-build/PushPlugin并显示通知工作。