public static void Initialize(IInsightsInitializer initializer, string insightsKey, bool suppressException = true) { if (string.IsNullOrWhiteSpace(insightsKey)) { return; } try { // see https://developer.xamarin.com/guides/insights/platform-features/advanced-topics/dealing-with-startup-crashes/ Insights.HasPendingCrashReport += (sender, isStartupCrash) => { if (isStartupCrash) { Insights.PurgePendingCrashReports().Wait(); } }; initializer.Initialize(insightsKey); } catch { // If we fail to setup our error report code no reason to throw an exception we'll never see. Godspeed user. if (!suppressException) { throw; } } }
protected IInsightsInitializerTests(IInsightsInitializer platformInitializer) { _platformInitializer = platformInitializer; }