Call configure only for Android

This commit is contained in:
Sebastián Katzer 2014-11-04 14:57:23 +00:00
parent a7e11b7c0e
commit dd6ed1a183

View File

@ -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]);
}; };