Share address button for mobile

This commit is contained in:
Gustavo Maximiliano Cortez 2015-01-27 11:52:16 -03:00
parent 77f8faaae6
commit 3ab53e5abf
3 changed files with 16 additions and 0 deletions

View File

@ -109,6 +109,9 @@ if [ ! -d $PROJECT ]; then
cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git
checkOK
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git && cordova prepare
checkOK
fi
if $DBGJS

View File

@ -17,9 +17,16 @@ angular.module('copayApp.controllers').controller('ReceiveController',
}
};
$scope.shareAddress = function(addr) {
if (isCordova) {
window.plugins.socialsharing.share('My bitcoin address: ' + addr);
}
};
$scope.init = function() {
$rootScope.title = 'Receive';
$scope.showAll = false;
$scope.isCordova = isCordova;
var w = $rootScope.wallet;
var lastAddr = _.first(w.getAddressesOrdered());

View File

@ -16,6 +16,12 @@
<h4 class="size-12">{{addr}}</h4>
</div>
</div>
<div class="m10t text-center" ng-show="isCordova">
<a href class="button-setup"
ng-click="shareAddress(addr)">
<i class="fi-share"></i> Share address
</a>
</div>
<div class="line-t m10t size-12">
Share this with anyone to have them send you payments. To protect your privacy, new addresses are generated automatically once you use them.
</div>