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

add lots of misc thigns to appdelegate

This commit is contained in:
Kyle Spearrin
2019-06-11 23:04:41 -04:00
parent 5aac96edb5
commit 5dbe9e5ca2
5 changed files with 260 additions and 7 deletions

View File

@@ -0,0 +1,40 @@
using Bit.Core.Abstractions;
using HockeyApp.iOS;
using Newtonsoft.Json;
using System.Threading.Tasks;
namespace Bit.iOS.Core.Utilities
{
public class HockeyAppCrashManagerDelegate : BITCrashManagerDelegate
{
private readonly IAppIdService _appIdService;
private readonly IUserService _userService;
private string _userId;
private string _appId;
public HockeyAppCrashManagerDelegate(
IAppIdService appIdService,
IUserService userService)
{
_appIdService = appIdService;
_userService = userService;
}
public async Task InitAsync(BITHockeyManager manager)
{
_userId = await _userService.GetUserIdAsync();
_appId = await _appIdService.GetAppIdAsync();
manager.UserId = _userId;
}
public override string ApplicationLogForCrashManager(BITCrashManager crashManager)
{
return JsonConvert.SerializeObject(new
{
AppId = _appId,
UserId = _userId
}, Formatting.Indented);
}
}
}