Add web intent plugin and bitcoin uri handler
This commit is contained in:
parent
b8fcc16a9d
commit
7c29eefab3
6 changed files with 326 additions and 1 deletions
15
js/mobile.js
15
js/mobile.js
|
|
@ -13,4 +13,19 @@ function onDeviceReady() {
|
|||
if (menu.offsetParent) menu.click();
|
||||
|
||||
}, false);
|
||||
|
||||
|
||||
function handleBitcoinURI(url) {
|
||||
if (!url) return;
|
||||
|
||||
var body = document.getElementsByTagName('nav')[0];
|
||||
var $rootScope = angular.element(body).scope();
|
||||
$rootScope.pendingPayment = copay.HDPath.parseBitcoinURI(url);
|
||||
|
||||
// Redirect or reload controller (if already there)
|
||||
window.location = ($rootScope.wallet ? '#!/send' : '#!/open') + '?r=' + Math.random();
|
||||
}
|
||||
|
||||
window.plugins.webintent.getUri(handleBitcoinURI);
|
||||
window.plugins.webintent.onNewIntent(handleBitcoinURI);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue