mirror of https://github.com/BTCPrivate/copay.git
also try to register handlers in non-cordova environments
This commit is contained in:
parent
7433b1b863
commit
38b8240341
|
@ -6,6 +6,15 @@ angular.element(document).ready(function() {
|
|||
var startAngular = function() {
|
||||
angular.bootstrap(document, ['copayApp']);
|
||||
};
|
||||
|
||||
var handleBitcoinURI = function(url) {
|
||||
if (!url) return;
|
||||
setTimeout(function() {
|
||||
window.location = '#/uri-payment/' + url;
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
|
||||
/* Cordova specific Init */
|
||||
if (window.cordova !== undefined) {
|
||||
|
||||
|
@ -37,8 +46,7 @@ angular.element(document).ready(function() {
|
|||
var loc = window.location;
|
||||
if (loc.toString().match(/index\.html#\/$/)) {
|
||||
navigator.app.exitApp();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
window.location = '#/cordova/walletHome';
|
||||
}
|
||||
}, false);
|
||||
|
@ -53,13 +61,6 @@ angular.element(document).ready(function() {
|
|||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
function handleBitcoinURI(url) {
|
||||
if (!url) return;
|
||||
setTimeout(function() {
|
||||
window.location = '#/uri-payment/' + url;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
window.plugins.webintent.getUri(handleBitcoinURI);
|
||||
window.plugins.webintent.onNewIntent(handleBitcoinURI);
|
||||
window.handleOpenURL = handleBitcoinURI;
|
||||
|
@ -67,6 +68,13 @@ angular.element(document).ready(function() {
|
|||
startAngular();
|
||||
}, false);
|
||||
} else {
|
||||
|
||||
try {
|
||||
window.handleOpenURL = handleBitcoinURI;
|
||||
window.plugins.webintent.getUri(handleBitcoinURI);
|
||||
window.plugins.webintent.onNewIntent(handleBitcoinURI);
|
||||
} catch (e) {}
|
||||
|
||||
startAngular();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue