Added implementation of BITCrashManagerDelegate for additional contextual information in crash reports. Include AppId.

This commit is contained in:
Kyle Spearrin 2016-07-22 17:55:11 -04:00
parent 89da89a9a1
commit 50b0770fd0
5 changed files with 43 additions and 10 deletions

View File

@ -0,0 +1,20 @@
using Bit.App.Abstractions;
using HockeyApp.iOS;
namespace Bit.iOS.Core
{
public class HockeyAppCrashManagerDelegate : BITCrashManagerDelegate
{
private readonly IAppIdService _appIdService;
public HockeyAppCrashManagerDelegate(
IAppIdService appIdService)
{
_appIdService = appIdService;
}
public override string ApplicationLogForCrashManager(BITCrashManager crashManager)
{
return $"AppId:{_appIdService.AppId}";
}
}
}

View File

@ -33,6 +33,14 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="HockeySDK, Version=1.0.6018.21546, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\Xamarin.iOS10\HockeySDK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HockeySDK.iOSBindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\Xamarin.iOS10\HockeySDK.iOSBindings.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Plugin.Settings, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xam.Plugins.Settings.2.1.0\lib\Xamarin.iOS10\Plugin.Settings.dll</HintPath>
<Private>True</Private>
@ -63,6 +71,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Constants.cs" />
<Compile Include="HockeyAppCrashManagerDelegate.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\KeyChainStorageService.cs" />
<Compile Include="Services\Settings.cs" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HockeySDK.Xamarin" version="4.1.0-beta3" targetFramework="xamarinios10" />
<package id="sqlite-net-pcl" version="1.1.2" targetFramework="xamarinios10" />
<package id="SQLitePCL.bundle_green" version="0.9.2" targetFramework="xamarinios10" />
<package id="SQLitePCL.raw" version="0.9.2" targetFramework="xamarinios10" />

View File

@ -37,8 +37,14 @@ namespace Bit.iOS.Extension
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
_context.ExtContext = ExtensionContext;
if(!Resolver.IsSet)
{
SetIoc();
}
if(!_setupHockeyApp)
{
var crashManagerDelegate = new HockeyAppCrashManagerDelegate(Resolver.Resolve<IAppIdService>());
var manager = HockeyApp.iOS.BITHockeyManager.SharedHockeyManager;
manager.Configure("51f96ae568ba45f699a18ad9f63046c3");
manager.StartManager();
@ -46,11 +52,6 @@ namespace Bit.iOS.Extension
_setupHockeyApp = true;
}
if(!Resolver.IsSet)
{
SetIoc();
}
foreach(var item in ExtensionContext.InputItems)
{
var processed = false;

View File

@ -26,6 +26,7 @@ using Plugin.Connectivity.Abstractions;
using Bit.App.Pages;
using PushNotification.Plugin.Abstractions;
using HockeyApp.iOS;
using Bit.iOS.Core;
namespace Bit.iOS
{
@ -38,16 +39,17 @@ namespace Bit.iOS
{
global::Xamarin.Forms.Forms.Init();
var manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("51f96ae568ba45f699a18ad9f63046c3");
manager.StartManager();
manager.Authenticator.AuthenticateInstallation();
if(!Resolver.IsSet)
{
SetIoc();
}
var crashManagerDelegate = new HockeyAppCrashManagerDelegate(Resolver.Resolve<IAppIdService>());
var manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("51f96ae568ba45f699a18ad9f63046c3", crashManagerDelegate);
manager.StartManager();
manager.Authenticator.AuthenticateInstallation();
LoadApplication(new App.App(
Resolver.Resolve<IAuthService>(),
Resolver.Resolve<IConnectivity>(),