diff --git a/src/iOS.Core/HockeyAppCrashManagerDelegate.cs b/src/iOS.Core/HockeyAppCrashManagerDelegate.cs new file mode 100644 index 000000000..c5173f5e3 --- /dev/null +++ b/src/iOS.Core/HockeyAppCrashManagerDelegate.cs @@ -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}"; + } + } +} diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index 45cf129b1..bece2739b 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -33,6 +33,14 @@ false + + ..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\Xamarin.iOS10\HockeySDK.dll + True + + + ..\..\packages\HockeySDK.Xamarin.4.1.0-beta3\lib\Xamarin.iOS10\HockeySDK.iOSBindings.dll + True + ..\..\packages\Xam.Plugins.Settings.2.1.0\lib\Xamarin.iOS10\Plugin.Settings.dll True @@ -63,6 +71,7 @@ + diff --git a/src/iOS.Core/packages.config b/src/iOS.Core/packages.config index e67a1c5eb..9d1d5758c 100644 --- a/src/iOS.Core/packages.config +++ b/src/iOS.Core/packages.config @@ -1,5 +1,6 @@  + diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index 80f1d61da..6d480192c 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -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()); 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; diff --git a/src/iOS/AppDelegate.cs b/src/iOS/AppDelegate.cs index f8107bd29..e895d0c34 100644 --- a/src/iOS/AppDelegate.cs +++ b/src/iOS/AppDelegate.cs @@ -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()); + var manager = BITHockeyManager.SharedHockeyManager; + manager.Configure("51f96ae568ba45f699a18ad9f63046c3", crashManagerDelegate); + manager.StartManager(); + manager.Authenticator.AuthenticateInstallation(); + LoadApplication(new App.App( Resolver.Resolve(), Resolver.Resolve(),