Add web intent plugin and bitcoin uri handler

This commit is contained in:
Yemel Jardi 2014-08-15 11:34:43 -03:00
commit 7c29eefab3
6 changed files with 326 additions and 1 deletions

View file

@ -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);
}