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:
40
src/iOS.Core/Utilities/HockeyAppCrashManagerDelegate.cs
Normal file
40
src/iOS.Core/Utilities/HockeyAppCrashManagerDelegate.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user