Merge pull request #1099 from yemel/feature/android-uri-handling

Implement bitcoin URI Handling on Android
This commit is contained in:
Matias Alejo Garcia 2014-08-16 00:11:38 -04:00
commit 8975b70530
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 = new bitcore.BIP21(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);
}