-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblackspace.js
33 lines (27 loc) · 1.23 KB
/
blackspace.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
Blackspace (Israeli TV show) - S01E03 14:57
Source:
https://github.com/apache/cordova-android/blob/master/cordova-js-src/platform.js
*/
module.exports = {
id: 'android',
test: function(){
new channel
},
bootstrap: function() {
var channel = require('cordova/channel');
var cordova = require('cordova');
var exec = require('cordova/exec');
var modulemapper = require('cordova/modulemapper');
// Get the shared secret needed to use the bridge.
exec.init();
// TODO: Extract this as a proper plugin.
modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
// Inject a listener for the backbutton on the document.
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
backButtonChannel.onHasSubscribersChange = function () {
// If we just attached the first handler or detached the last handler,
// let native know we need to override the back button.
exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [this.numHandlers === 1]);
};