From 826d9fe0724328775b618f7f811f8871345e6c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Wed, 16 Nov 2016 12:58:55 -0300 Subject: [PATCH] fix share buttons --- app-template/config-template.xml | 1 + src/js/controllers/feedback/complete.js | 29 +++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app-template/config-template.xml b/app-template/config-template.xml index 9f54116f4..406dc1c34 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -65,6 +65,7 @@ + diff --git a/src/js/controllers/feedback/complete.js b/src/js/controllers/feedback/complete.js index 80018be79..2422a22ec 100644 --- a/src/js/controllers/feedback/complete.js +++ b/src/js/controllers/feedback/complete.js @@ -7,7 +7,7 @@ angular.module('copayApp.controllers').controller('completeController', function var config = configService.getSync(); $scope.shareFacebook = function() { - window.plugins.socialsharing.shareViaFacebook(config.download.url, null, null, null); + window.plugins.socialsharing.shareVia($scope.shareFacebookVia, config.download.url, null, null, null, null, null); }; $scope.shareTwitter = function() { @@ -31,7 +31,7 @@ angular.module('copayApp.controllers').controller('completeController', function }; $scope.$on("$ionicView.beforeEnter", function(event, data) { - if(window.StatusBar){ + if (window.StatusBar) { $log.debug('Hiding status bar...'); StatusBar.hide(); } @@ -49,17 +49,28 @@ angular.module('copayApp.controllers').controller('completeController', function $scope.socialsharing = isAvailable; if (isAvailable) { window.plugins.socialsharing.canShareVia('com.apple.social.facebook', 'msg', null, null, null, function(e) { + $scope.shareFacebookVia = 'com.apple.social.facebook'; $scope.facebook = true; }, function(e) { - $log.debug('facebook error: ' + e); - $scope.facebook = false; + window.plugins.socialsharing.canShareVia('com.facebook.katana', 'msg', null, null, null, function(e) { + $scope.shareFacebookVia = 'com.facebook.katana'; + $scope.facebook = true; + }, function(e) { + $log.debug('facebook error: ' + e); + $scope.facebook = false; + }); }); - window.plugins.socialsharing.canShareVia('com.twitter.android', 'msg', null, null, null, function(e) { - $scope.shareTwitterVia = 'com.twitter.android'; + window.plugins.socialsharing.canShareVia('com.apple.social.twitter', 'msg', null, null, null, function(e) { + $scope.shareTwitterVia = 'com.apple.social.twitter'; $scope.twitter = true; }, function(e) { - $log.debug('twitter error: ' + e); - $scope.twitter = false; + window.plugins.socialsharing.canShareVia('com.twitter.android', 'msg', null, null, null, function(e) { + $scope.shareTwitterVia = 'com.twitter.android'; + $scope.twitter = true; + }, function(e) { + $log.debug('twitter error: ' + e); + $scope.twitter = false; + }); }); window.plugins.socialsharing.canShareVia('com.google.android.apps.plus', 'msg', null, null, null, function(e) { $scope.shareGooglePlusVia = 'com.google.android.apps.plus'; @@ -85,7 +96,7 @@ angular.module('copayApp.controllers').controller('completeController', function }); $scope.$on("$ionicView.afterLeave", function() { - if(window.StatusBar){ + if (window.StatusBar) { $log.debug('Showing status bar...'); StatusBar.show(); }