Merge pull request #2356 from cmgustavo/feature/share-address

Share address button for mobile
This commit is contained in:
Matias Pando 2015-01-29 11:40:32 -03:00
commit 5479451aac
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 cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git
checkOK checkOK
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git && cordova prepare
checkOK
fi fi
if $DBGJS 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() { $scope.init = function() {
$rootScope.title = 'Receive'; $rootScope.title = 'Receive';
$scope.showAll = false; $scope.showAll = false;
$scope.isCordova = isCordova;
var w = $rootScope.wallet; var w = $rootScope.wallet;
var lastAddr = _.first(w.getAddressesOrdered()); var lastAddr = _.first(w.getAddressesOrdered());

View file

@ -16,6 +16,12 @@
<h4 class="size-12">{{addr}}</h4> <h4 class="size-12">{{addr}}</h4>
</div> </div>
</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"> <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. Share this with anyone to have them send you payments. To protect your privacy, new addresses are generated automatically once you use them.
</div> </div>