added firebase events for backup, create, send, onboarding

This commit is contained in:
Kadir Sekha 2017-11-13 16:49:59 +09:00
commit 55beae0252
4 changed files with 13 additions and 6 deletions

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('backupController', angular.module('copayApp.controllers').controller('backupController',
function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, lodash, profileService, bwcService, walletService, ongoingProcess, popupService, gettextCatalog, $ionicModal) { function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, lodash, profileService, bwcService, walletService, ongoingProcess, popupService, gettextCatalog, $ionicModal, firebaseEventsService) {
$scope.wallet = profileService.getWallet($stateParams.walletId); $scope.wallet = profileService.getWallet($stateParams.walletId);
$scope.viewTitle = $scope.wallet.name || $scope.wallet.credentials.walletName; $scope.viewTitle = $scope.wallet.name || $scope.wallet.credentials.walletName;
$scope.n = $scope.wallet.n; $scope.n = $scope.wallet.n;
@ -78,6 +78,7 @@ angular.module('copayApp.controllers').controller('backupController',
$scope.setFlow(2); $scope.setFlow(2);
}) })
} else { } else {
firebaseEventsService.logEvent('backed_up_wallet');
openConfirmBackupModal(); openConfirmBackupModal();
} }
}; };

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, $stateParams, $window, $state, $log, profileService, bitcore, bitcoreCash, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, bwcError, txConfirmNotification, externalLinkService) { angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, $stateParams, $window, $state, $log, profileService, bitcore, bitcoreCash, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, bwcError, txConfirmNotification, externalLinkService, firebaseEventsService) {
var countDown = null; var countDown = null;
var CONFIRM_LIMIT_USD = 20; var CONFIRM_LIMIT_USD = 20;
@ -139,7 +139,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$ionicHistory.clearHistory(); $ionicHistory.clearHistory();
if (!back) { if (!back) {
var url = 'https://support.bitpay.com/hc/en-us/articles/115004671663'; var url = 'https://support.bitpay.com/hc/en-us/articles/115004671663';
externalLinkService.open(url); externalLinkService.open(url);
} }
}); });
}); });
@ -594,6 +594,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
(processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal()) (processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal())
) && !isOn) { ) && !isOn) {
$scope.sendStatus = 'success'; $scope.sendStatus = 'success';
firebaseEventsService.logEvent('sent_bitcoin');
$timeout(function() { $timeout(function() {
$scope.$digest(); $scope.$digest();
}, 100); }, 100);

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('createController', angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $timeout, $log, lodash, $state, $ionicScrollDelegate, $ionicHistory, profileService, configService, gettextCatalog, ledger, trezor, intelTEE, derivationPathHelper, ongoingProcess, walletService, storageService, popupService, appConfigService, pushNotificationsService) { function($scope, $rootScope, $timeout, $log, lodash, $state, $ionicScrollDelegate, $ionicHistory, profileService, configService, gettextCatalog, ledger, trezor, intelTEE, derivationPathHelper, ongoingProcess, walletService, storageService, popupService, appConfigService, pushNotificationsService, firebaseEventsService) {
/* For compressed keys, m*73 + n*34 <= 496 */ /* For compressed keys, m*73 + n*34 <= 496 */
var COPAYER_PAIR_LIMITS = { var COPAYER_PAIR_LIMITS = {
@ -261,7 +261,11 @@ angular.module('copayApp.controllers').controller('createController',
walletId: client.credentials.walletId walletId: client.credentials.walletId
}); });
}, 100); }, 100);
} else $state.go('tabs.home'); }
else {
firebaseEventsService.logEvent('wallet_created', { coin: opts.coin });
$state.go('tabs.home');
}
}); });
}, 300); }, 300);
} }

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope) { angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope, firebaseEventsService) {
$scope.$on("$ionicView.afterEnter", function() { $scope.$on("$ionicView.afterEnter", function() {
startupService.ready(); startupService.ready();
@ -28,6 +28,7 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
profileService.setDisclaimerAccepted(function(err) { profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err); if (err) $log.error(err);
else { else {
firebaseEventsService.logEvent('completed_onboarding');
$state.go('tabs.home', { $state.go('tabs.home', {
fromOnboarding: true fromOnboarding: true
}); });