1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-30 15:13:24 +00:00

Added track screen events for pages and controller in extension. UserId refresh on login/logout.

This commit is contained in:
Kyle Spearrin
2016-08-04 00:06:09 -04:00
parent c86c82ee69
commit a831c9ac4f
27 changed files with 498 additions and 6512 deletions

View File

@@ -2,6 +2,7 @@
{
public interface IGoogleAnalyticsService
{
void RefreshUserId();
void TrackPage(string pageName);
void TrackEvent(string category, string eventName);
void TrackException(string message, bool fatal);

View File

@@ -28,6 +28,7 @@ namespace Bit.App
private readonly ISettings _settings;
private readonly IPushNotification _pushNotification;
private readonly ILockService _lockService;
private readonly IGoogleAnalyticsService _googleAnalyticsService;
public App(
IAuthService authService,
@@ -38,7 +39,8 @@ namespace Bit.App
IFingerprint fingerprint,
ISettings settings,
IPushNotification pushNotification,
ILockService lockService)
ILockService lockService,
IGoogleAnalyticsService googleAnalyticsService)
{
_databaseService = databaseService;
_connectivity = connectivity;
@@ -49,6 +51,7 @@ namespace Bit.App
_settings = settings;
_pushNotification = pushNotification;
_lockService = lockService;
_googleAnalyticsService = googleAnalyticsService;
SetStyles();
@@ -181,6 +184,7 @@ namespace Bit.App
private void Logout(string logoutMessage)
{
_authService.LogOut();
_googleAnalyticsService.RefreshUserId();
_pushNotification.Unregister();
Current.MainPage = new HomePage();
if(!string.IsNullOrWhiteSpace(logoutMessage))

View File

@@ -22,6 +22,7 @@ namespace Bit.App.Pages
private IUserDialogs _userDialogs;
private ISyncService _syncService;
private ISettings _settings;
private IGoogleAnalyticsService _googleAnalyticsService;
public LoginPage()
{
@@ -32,6 +33,7 @@ namespace Bit.App.Pages
_userDialogs = Resolver.Resolve<IUserDialogs>();
_syncService = Resolver.Resolve<ISyncService>();
_settings = Resolver.Resolve<ISettings>();
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
Init();
}
@@ -178,6 +180,7 @@ namespace Bit.App.Pages
_authService.UserId = response.Result?.Profile?.Id;
_authService.Email = response.Result?.Profile?.Email;
_settings.AddOrUpdateValue(Constants.SettingLastLoginEmail, _authService.Email);
_googleAnalyticsService.RefreshUserId();
if(_authService.IsAuthenticatedTwoFactor)
{