Open nemr opened 7 years ago
Alert() doesn't work in background modus, the plugin uses the following code for that:
cordova.plugins.backgroundMode.setDefaults({ title: String, text: String, icon: 'icon' // this will look for icon.png in platforms/android/res/drawable|mipmap color: String // hex format like 'F14F4D' resume: Boolean, hidden: Boolean, bigText: Boolean })
I'm still learning to work with this plugin but I think this will make a change ;)
Hello ,
I'm trying to disable the background mode after 10 seconds in the background.
I'm trying to display an alert and then disable background mode . non of them are happing , the alert doesn't show up and it sill works in the background.
Am I implementing it correctly ? or is it limited to some specific actions when in background.
I'm developing for iOS
`var app = { // Application Constructor initialize: function() { document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); },
};
app.initialize();
`
also if I only enable background and console log it won't print but if I only console log without enabling background it will console log
` onDeviceReady: function() { this.receivedEvent('deviceready'); cordova.plugins.backgroundMode.enable(); console.log("Background Enabled") // doesn't console log
` onDeviceReady: function() { this.receivedEvent('deviceready'); console.log("Background Enabled") // does console log