Adds bitcoincash URL support

This commit is contained in:
Gustavo Maximiliano Cortez 2017-09-08 16:55:04 -03:00
commit 823814817d
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
8 changed files with 45 additions and 26 deletions

View file

@ -63,12 +63,16 @@ angular.module('copayApp.controllers').controller('customAmountController', func
$scope.shareAddress = function() {
if (!platformInfo.isCordova) return;
var data = 'bitcoin:' + $scope.address + '?amount=' + $scope.amountBtc + '&coin=' + $scope.wallet.coin;
var protocol = 'bitcoin';
if ($scope.wallet.coin == 'bch') protocol += 'cash';
var data = protocol + ':' + $scope.address + '?amount=' + $scope.amountBtc;
window.plugins.socialsharing.share(data, null, null, null);
}
$scope.copyToClipboard = function() {
return 'bitcoin:' + $scope.address + '?amount=' + $scope.amountBtc + '&coin=' + $scope.wallet.coin;
var protocol = 'bitcoin';
if ($scope.wallet.coin == 'bch') protocol += 'cash';
return protocol + ':' + $scope.address + '?amount=' + $scope.amountBtc;
};
});