2013-10-09 08:50:15 +00:00
|
|
|
/**
|
|
|
|
* background-mode.js
|
|
|
|
* Cordova Background-Mode Plugin
|
|
|
|
*
|
|
|
|
* Created by Sebastian Katzer (github.com/katzer) on 09/10/2013.
|
|
|
|
* Copyright 2013 Sebastian Katzer. All rights reserved.
|
|
|
|
* GPL v2 licensed
|
|
|
|
*/
|
|
|
|
|
|
|
|
var BackgroundMode = function () {
|
2013-10-09 09:40:06 +00:00
|
|
|
// Registriert die Listener für die (sleep/resume) Events
|
|
|
|
cordova.exec(null, null, 'BackgroundMode', 'observeLifeCycle', []);
|
2013-10-09 08:50:15 +00:00
|
|
|
};
|
|
|
|
|
2013-10-09 08:54:57 +00:00
|
|
|
BackgroundMode.prototype = {
|
2013-10-09 08:50:15 +00:00
|
|
|
/**
|
2013-10-09 09:40:06 +00:00
|
|
|
* @public
|
|
|
|
*
|
2013-10-09 08:50:15 +00:00
|
|
|
* Aktiviert den Hintergrundmodus.
|
|
|
|
*/
|
2013-10-09 12:54:23 +00:00
|
|
|
enable: function () {
|
|
|
|
cordova.exec(null, null, 'BackgroundMode', 'enable', []);
|
2013-10-09 08:50:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2013-10-09 09:40:06 +00:00
|
|
|
* @public
|
|
|
|
*
|
2013-10-09 08:50:15 +00:00
|
|
|
* Deaktiviert den Hintergrundmodus
|
|
|
|
*/
|
2013-10-09 12:54:23 +00:00
|
|
|
disable: function () {
|
|
|
|
cordova.exec(null, null, 'BackgroundMode', 'disable', []);
|
2013-10-09 08:50:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var plugin = new BackgroundMode();
|
|
|
|
|
|
|
|
module.exports = plugin;
|