Tracked a few events in the main app.

This commit is contained in:
Kyle Spearrin 2016-08-04 00:32:37 -04:00
parent 561c972c96
commit 7ba4baa5ce
4 changed files with 17 additions and 3 deletions

View File

@ -184,6 +184,7 @@ namespace Bit.App
private void Logout(string logoutMessage)
{
_authService.LogOut();
_googleAnalyticsService.TrackAppEvent("LoggedOut");
_googleAnalyticsService.RefreshUserId();
_pushNotification.Unregister();
Current.MainPage = new HomePage();

View File

@ -181,6 +181,7 @@ namespace Bit.App.Pages
_authService.Email = response.Result?.Profile?.Email;
_settings.AddOrUpdateValue(Constants.SettingLastLoginEmail, _authService.Email);
_googleAnalyticsService.RefreshUserId();
_googleAnalyticsService.TrackAppEvent("LoggedIn");
if(_authService.IsAuthenticatedTwoFactor)
{

View File

@ -16,12 +16,14 @@ namespace Bit.App.Pages
private ICryptoService _cryptoService;
private IUserDialogs _userDialogs;
private IAccountsApiRepository _accountsApiRepository;
private IGoogleAnalyticsService _googleAnalyticsService;
public RegisterPage()
{
_cryptoService = Resolver.Resolve<ICryptoService>();
_userDialogs = Resolver.Resolve<IUserDialogs>();
_accountsApiRepository = Resolver.Resolve<IAccountsApiRepository>();
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
Init();
}
@ -183,6 +185,7 @@ namespace Bit.App.Pages
}
_userDialogs.Toast("Your new account has been created! You may now log in.");
_googleAnalyticsService.TrackAppEvent("Registered");
await Navigation.PopModalAsync();
}

View File

@ -16,6 +16,7 @@ namespace Bit.App.Pages
private readonly IPasswordGenerationService _passwordGenerationService;
private readonly ISettings _settings;
private readonly IClipboardService _clipboardService;
private readonly IGoogleAnalyticsService _googleAnalyticsService;
private readonly Action<string> _passwordValueAction;
public ToolsPasswordGeneratorPage(Action<string> passwordValueAction = null)
@ -24,6 +25,7 @@ namespace Bit.App.Pages
_passwordGenerationService = Resolver.Resolve<IPasswordGenerationService>();
_settings = Resolver.Resolve<ISettings>();
_clipboardService = Resolver.Resolve<IClipboardService>();
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
_passwordValueAction = passwordValueAction;
Init();
@ -127,14 +129,14 @@ namespace Bit.App.Pages
protected override void OnAppearing()
{
Model.Password = _passwordGenerationService.GeneratePassword();
Model.Length = _settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10).ToString();
base.OnAppearing();
GeneratePassword();
Model.Length = _settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10).ToString();
}
private void RegenerateCell_Tapped(object sender, EventArgs e)
{
Model.Password = _passwordGenerationService.GeneratePassword();
GeneratePassword();
}
private void CopyCell_Tapped(object sender, EventArgs e)
@ -147,8 +149,15 @@ namespace Bit.App.Pages
Navigation.PushAsync(new ToolsPasswordGeneratorSettingsPage());
}
private void GeneratePassword()
{
_googleAnalyticsService.TrackAppEvent("GeneratedPassword");
Model.Password = _passwordGenerationService.GeneratePassword();
}
private void CopyPassword()
{
_googleAnalyticsService.TrackAppEvent("CopiedGeneratedPassword");
_clipboardService.CopyToClipboard(Password.Text);
_userDialogs.Toast(string.Format(AppResources.ValueHasBeenCopied, AppResources.Password));
}