rate the app

This commit is contained in:
Javier 2016-11-02 10:18:10 -03:00 committed by Gabriel Bazán
commit 9e3f627c58
5 changed files with 31 additions and 7 deletions

View file

@ -1,7 +1,12 @@
'use strict';
angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams) {
angular.module('copayApp.controllers').controller('rateAppStoreController', function($scope, $state, $stateParams, externalLinkService, configService, gettextCatalog, platformInfo) {
$scope.score = parseInt($stateParams.score);
$scope.isCordova = platformInfo.isCordova;
var isAndroid = platformInfo.isAndroid;
var isIOS = platformInfo.isIOS;
var isWP = platformInfo.isWP;
var config = configService.getSync();
$scope.skip = function() {
$state.go('feedback.thanks', {
@ -17,6 +22,14 @@ angular.module('copayApp.controllers').controller('rateAppStoreController', func
};
$scope.goAppStore = function() {
var url;
if (isAndroid) url = config.rateApp.android;
if (isIOS) url = config.rateApp.ios;
// if (isWP) url = config.rateApp.ios; TODO
var title = gettextCatalog.getString('Rate the app');
var message = gettextCatalog.getString('You must go to the official website of the app to rate it');
var okText = gettextCatalog.getString('Go');
var cancelText = gettextCatalog.getString('Cancel');
externalLinkService.open(url, true, title, message, okText, cancelText);
};
});

View file

@ -1,12 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo) {
angular.module('copayApp.controllers').controller('thanksController', function($scope, $state, $stateParams, platformInfo, configService) {
$scope.score = parseInt($stateParams.score);
$scope.skip = $stateParams.skip && $scope.score == 5;
$scope.$on("$ionicView.beforeEnter", function(event, data) {
if (platformInfo.isCordova) {
window.plugins.socialsharing.share('https://bitpay.com/wallet', null, null, null);
var config = configService.getSync();
window.plugins.socialsharing.share(config.download.url, null, null, null);
}
});
});