|
各位大神你们好:我遇到了一个关闭app,极光推送无法收到的问题,我查过资料,要用到cordova-plugin-background-mode插件 我也按照给的例子写了document.addEventListener('deviceready', function () {
// Android customization
cordova.plugins.backgroundMode.setDefaults({ text:'Doing heavy tasks.'});
// Enable background mode
cordova.plugins.backgroundMode.enable();
// Called when background mode has been activated
cordova.plugins.backgroundMode.onactivate = function () {
setTimeout(function () {
// Modify the currently displayed notification
cordova.plugins.backgroundMode.configure({
text:'Running in background for more than 5s now.'
});
}, 2000);
}
}, false);
可cordova.plugins.backgroundMode.onactivate就是进不去,拜托各位能帮帮我。。。。。
感谢
|
|