1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-27 05:33:23 +00:00

re-work hockeyapp init

This commit is contained in:
Kyle Spearrin
2019-07-23 09:08:16 -04:00
parent 0eddee5816
commit a0a5e30f48
4 changed files with 16 additions and 13 deletions

View File

@@ -30,8 +30,6 @@ namespace Bit.Droid
[Register("com.x8bit.bitwarden.MainActivity")]
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
private const string HockeyAppId = "d3834185b4a643479047b86c65293d42";
private IDeviceActionService _deviceActionService;
private IMessagingService _messagingService;
private IBroadcasterService _broadcasterService;
@@ -84,8 +82,7 @@ namespace Bit.Droid
#if !FDROID
var hockeyAppListener = new HockeyAppCrashManagerListener(_appIdService, _userService);
var hockeyAppTask = hockeyAppListener.InitAsync();
HockeyApp.Android.CrashManager.Register(this, HockeyAppId, hockeyAppListener);
var hockeyAppTask = hockeyAppListener.InitAsync(this);
#endif
Xamarin.Essentials.Platform.Init(this, savedInstanceState);

View File

@@ -5,11 +5,14 @@ using Newtonsoft.Json;
using Android.Runtime;
using Bit.Core.Abstractions;
using System.Threading.Tasks;
using Android.Content;
namespace Bit.Droid.Utilities
{
public class HockeyAppCrashManagerListener : CrashManagerListener
{
private const string HockeyAppId = "d3834185b4a643479047b86c65293d42";
private readonly IAppIdService _appIdService;
private readonly IUserService _userService;
@@ -31,10 +34,11 @@ namespace Bit.Droid.Utilities
_userService = userService;
}
public async Task InitAsync()
public async Task InitAsync(Context context)
{
_userId = await _userService.GetUserIdAsync();
_appId = await _appIdService.GetAppIdAsync();
CrashManager.Register(context, HockeyAppId, this);
}
public override string Description