1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-22 11:35:21 +01:00

Added manual display method to GA service. AutoFilled event for extension.

This commit is contained in:
Kyle Spearrin 2016-08-04 08:46:53 -04:00
parent d80735028c
commit dd633d4fc1
4 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,7 @@ namespace Bit.Android.Services
{
private const string UserId = "&uid";
private readonly GoogleAnalytics _instance;
private readonly IAuthService _authService;
private readonly Tracker _tracker;
private bool _setUserId = true;
@ -20,10 +21,10 @@ namespace Bit.Android.Services
{
_authService = authService;
var instance = GoogleAnalytics.GetInstance(appContext.ApplicationContext);
instance.SetLocalDispatchPeriod(10);
_instance = GoogleAnalytics.GetInstance(appContext.ApplicationContext);
_instance.SetLocalDispatchPeriod(10);
_tracker = instance.NewTracker("UA-81915606-2");
_tracker = _instance.NewTracker("UA-81915606-2");
_tracker.EnableExceptionReporting(true);
_tracker.EnableAdvertisingIdCollection(true);
_tracker.EnableAutoActivityTracking(true);
@ -85,5 +86,10 @@ namespace Bit.Android.Services
_setUserId = false;
}
}
public void Dispatch()
{
_instance.DispatchLocalHits();
}
}
}

View File

@ -8,5 +8,6 @@
void TrackExtensionEvent(string eventName, string label = null);
void TrackEvent(string category, string eventName, string label = null);
void TrackException(string message, bool fatal);
void Dispatch();
}
}

View File

@ -62,6 +62,11 @@ namespace Bit.iOS.Core.Services
_tracker.Send(dict);
}
public void Dispatch()
{
Gai.SharedInstance.Dispatch();
}
private void SetUserId()
{
if(_setUserId && _authService.IsAuthenticated)

View File

@ -228,6 +228,7 @@ namespace Bit.iOS.Extension
Constants.AppExtensionOldPasswordKey, password);
}
_googleAnalyticsService.TrackExtensionEvent("AutoFilled", _context.ProviderType);
CompleteRequest(itemData);
}