mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-22 07:14:54 +00:00
Call configure only for Android
This commit is contained in:
parent
a7e11b7c0e
commit
dd6ed1a183
@ -29,7 +29,7 @@ document.addEventListener('backbutton', function () {}, false);
|
|||||||
channel.deviceready.subscribe(function () {
|
channel.deviceready.subscribe(function () {
|
||||||
// Registriert die Listener für die (sleep/resume) Events
|
// Registriert die Listener für die (sleep/resume) Events
|
||||||
cordova.exec(null, null, 'BackgroundMode', 'observeLifeCycle', []);
|
cordova.exec(null, null, 'BackgroundMode', 'observeLifeCycle', []);
|
||||||
|
// Set the default settings
|
||||||
exports.configure();
|
exports.configure();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -75,6 +75,9 @@ exports.disable = function () {
|
|||||||
exports.configure = function (options) {
|
exports.configure = function (options) {
|
||||||
var settings = this.mergeWithDefaults(options || {});
|
var settings = this.mergeWithDefaults(options || {});
|
||||||
|
|
||||||
|
if (device.platform != 'Android')
|
||||||
|
return;
|
||||||
|
|
||||||
cordova.exec(null, null, 'BackgroundMode', 'configure', [settings]);
|
cordova.exec(null, null, 'BackgroundMode', 'configure', [settings]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user