mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-26 16:57:59 +01:00
fix analytics for autofill events
This commit is contained in:
parent
f57db917d1
commit
cc9a4a288a
@ -17,6 +17,7 @@ namespace Bit.iOS.Autofill
|
|||||||
|
|
||||||
public override Action Success => () =>
|
public override Action Success => () =>
|
||||||
{
|
{
|
||||||
|
_googleAnalyticsService.TrackAutofillExtensionEvent("CreatedLogin");
|
||||||
LoginListController?.DismissModal();
|
LoginListController?.DismissModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ namespace Bit.iOS.Autofill
|
|||||||
{
|
{
|
||||||
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
||||||
{
|
{
|
||||||
public PasswordGeneratorViewController(IntPtr handle) : base(handle)
|
public PasswordGeneratorViewController(IntPtr handle) : base(handle, true)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public LoginAddViewController Parent { get; set; }
|
public LoginAddViewController Parent { get; set; }
|
||||||
|
@ -22,10 +22,12 @@ namespace Bit.iOS.Core.Controllers
|
|||||||
private IFolderService _folderService;
|
private IFolderService _folderService;
|
||||||
private IConnectivity _connectivity;
|
private IConnectivity _connectivity;
|
||||||
private IEnumerable<Folder> _folders;
|
private IEnumerable<Folder> _folders;
|
||||||
private IGoogleAnalyticsService _googleAnalyticsService;
|
protected IGoogleAnalyticsService _googleAnalyticsService;
|
||||||
|
private bool _isAutofill;
|
||||||
|
|
||||||
public LoginAddViewController(IntPtr handle) : base(handle)
|
public LoginAddViewController(IntPtr handle) : base(handle)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public AppExtensionContext Context { get; set; }
|
public AppExtensionContext Context { get; set; }
|
||||||
public FormEntryTableViewCell NameCell { get; set; } = new FormEntryTableViewCell(AppResources.Name);
|
public FormEntryTableViewCell NameCell { get; set; } = new FormEntryTableViewCell(AppResources.Name);
|
||||||
@ -171,7 +173,6 @@ namespace Bit.iOS.Core.Controllers
|
|||||||
await loadingAlert.DismissViewControllerAsync(true);
|
await loadingAlert.DismissViewControllerAsync(true);
|
||||||
if(saveTask.Result.Succeeded)
|
if(saveTask.Result.Succeeded)
|
||||||
{
|
{
|
||||||
_googleAnalyticsService.TrackExtensionEvent("CreatedLogin");
|
|
||||||
Success();
|
Success();
|
||||||
}
|
}
|
||||||
else if(saveTask.Result.Errors.Count() > 0)
|
else if(saveTask.Result.Errors.Count() > 0)
|
||||||
|
@ -17,9 +17,12 @@ namespace Bit.iOS.Core.Controllers
|
|||||||
{
|
{
|
||||||
private IPasswordGenerationService _passwordGenerationService;
|
private IPasswordGenerationService _passwordGenerationService;
|
||||||
private ISettings _settings;
|
private ISettings _settings;
|
||||||
|
private bool _isAutofill;
|
||||||
|
|
||||||
public PasswordGeneratorViewController(IntPtr handle) : base(handle)
|
public PasswordGeneratorViewController(IntPtr handle, bool autofill) : base(handle)
|
||||||
{ }
|
{
|
||||||
|
_isAutofill = autofill;
|
||||||
|
}
|
||||||
|
|
||||||
protected IGoogleAnalyticsService GoogleAnalyticsService { get; private set; }
|
protected IGoogleAnalyticsService GoogleAnalyticsService { get; private set; }
|
||||||
public UITableViewController OptionsTableViewController { get; set; }
|
public UITableViewController OptionsTableViewController { get; set; }
|
||||||
@ -146,7 +149,14 @@ namespace Bit.iOS.Core.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
GeneratePassword();
|
GeneratePassword();
|
||||||
GoogleAnalyticsService.TrackExtensionEvent("GeneratedPassword");
|
if(_isAutofill)
|
||||||
|
{
|
||||||
|
GoogleAnalyticsService.TrackAutofillExtensionEvent("GeneratedPassword");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GoogleAnalyticsService.TrackExtensionEvent("GeneratedPassword");
|
||||||
|
}
|
||||||
base.ViewDidLoad();
|
base.ViewDidLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,12 +314,26 @@ namespace Bit.iOS.Core.Controllers
|
|||||||
{
|
{
|
||||||
if(indexPath.Row == 0)
|
if(indexPath.Row == 0)
|
||||||
{
|
{
|
||||||
_controller.GoogleAnalyticsService.TrackExtensionEvent("RegeneratedPassword");
|
if(_controller._isAutofill)
|
||||||
|
{
|
||||||
|
_controller.GoogleAnalyticsService.TrackAutofillExtensionEvent("RegeneratedPassword");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_controller.GoogleAnalyticsService.TrackExtensionEvent("RegeneratedPassword");
|
||||||
|
}
|
||||||
_controller.GeneratePassword();
|
_controller.GeneratePassword();
|
||||||
}
|
}
|
||||||
else if(indexPath.Row == 1)
|
else if(indexPath.Row == 1)
|
||||||
{
|
{
|
||||||
_controller.GoogleAnalyticsService.TrackExtensionEvent("CopiedGeneratedPassword");
|
if(_controller._isAutofill)
|
||||||
|
{
|
||||||
|
_controller.GoogleAnalyticsService.TrackAutofillExtensionEvent("CopiedGeneratedPassword");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_controller.GoogleAnalyticsService.TrackExtensionEvent("CopiedGeneratedPassword");
|
||||||
|
}
|
||||||
UIPasteboard clipboard = UIPasteboard.General;
|
UIPasteboard clipboard = UIPasteboard.General;
|
||||||
clipboard.String = _controller.BasePasswordLabel.Text;
|
clipboard.String = _controller.BasePasswordLabel.Text;
|
||||||
var alert = Dialogs.CreateMessageAlert(AppResources.Copied);
|
var alert = Dialogs.CreateMessageAlert(AppResources.Copied);
|
||||||
|
@ -18,6 +18,7 @@ namespace Bit.iOS.Extension
|
|||||||
|
|
||||||
public override Action Success => () =>
|
public override Action Success => () =>
|
||||||
{
|
{
|
||||||
|
_googleAnalyticsService.TrackExtensionEvent("CreatedLogin");
|
||||||
if(LoginListController != null)
|
if(LoginListController != null)
|
||||||
{
|
{
|
||||||
LoginListController.DismissModal();
|
LoginListController.DismissModal();
|
||||||
|
@ -5,7 +5,7 @@ namespace Bit.iOS.Extension
|
|||||||
{
|
{
|
||||||
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
||||||
{
|
{
|
||||||
public PasswordGeneratorViewController(IntPtr handle) : base(handle)
|
public PasswordGeneratorViewController(IntPtr handle) : base(handle, false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public LoginAddViewController Parent { get; set; }
|
public LoginAddViewController Parent { get; set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user