cordova-plugin-run-in-backg.../www/background-mode.js

37 lines
847 B
JavaScript
Raw Normal View History

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 () {
// 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
/**
* @public
*
2013-10-09 08:50:15 +00:00
* Aktiviert den Hintergrundmodus.
*/
activate: function () {
cordova.exec(null, null, 'BackgroundMode', 'activate', []);
},
/**
* @public
*
2013-10-09 08:50:15 +00:00
* Deaktiviert den Hintergrundmodus
*/
deactivate: function () {
2013-10-09 08:50:15 +00:00
cordova.exec(null, null, 'BackgroundMode', 'deactivate', []);
}
};
var plugin = new BackgroundMode();
module.exports = plugin;