public override NSArray AttachmentsWithCrashes(MacOSCrashes crashes, MSACErrorReport msReport) { if (GetErrorAttachments == null) { return(null); } var report = new ErrorReport(msReport); var attachments = GetErrorAttachments(report); if (attachments != null) { var nsArray = new NSMutableArray(); foreach (var attachment in attachments) { if (attachment != null) { nsArray.Add(attachment.internalAttachment); } else { AppCenterLog.Warn(LogTag, "Skipping null ErrorAttachmentLog in Crashes.GetErrorAttachments."); } } return(nsArray); } return(null); }
public override bool CrashesShouldProcessErrorReport(MacOSCrashes crashes, MSACErrorReport msReport) { if (ShouldProcessErrorReport == null) { return(true); } var report = new ErrorReport(msReport); return(ShouldProcessErrorReport(report)); }
public override void CrashesDidSucceedSendingErrorReport(MacOSCrashes crashes, MSACErrorReport msReport) { if (SentErrorReport != null) { var report = new ErrorReport(msReport); var e = new SentErrorReportEventArgs { Report = report }; SentErrorReport(null, e); } }
public override void CrashesDidFailSendingErrorReport(MacOSCrashes crashes, MSACErrorReport msReport, NSError error) { if (FailedToSendErrorReport != null) { var report = new ErrorReport(msReport); var e = new FailedToSendErrorReportEventArgs { Report = report, Exception = error }; FailedToSendErrorReport(null, e); } }
static Crashes() { /* Perform custom setup around the native SDK's for setting signal handlers */ MacOSCrashes.DisableMachExceptionHandler(); MSACWrapperCrashesHelper.SetCrashHandlerSetupDelegate(_crashesInitializationDelegate); AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; MacOSCrashes.SetUserConfirmationHandler((reports) => { if (ShouldAwaitUserConfirmation != null) { return(ShouldAwaitUserConfirmation()); } return(false); }); MacOSCrashes.SetDelegate(_crashesDelegate); }
static void PlatformNotifyUserConfirmation(UserConfirmation confirmation) { MSACUserConfirmation macosUserConfirmation; switch (confirmation) { case UserConfirmation.Send: macosUserConfirmation = MSACUserConfirmation.Send; break; case UserConfirmation.DontSend: macosUserConfirmation = MSACUserConfirmation.DontSend; break; case UserConfirmation.AlwaysSend: macosUserConfirmation = MSACUserConfirmation.Always; break; default: throw new ArgumentOutOfRangeException(nameof(confirmation), confirmation, null); } MacOSCrashes.NotifyWithUserConfirmation(macosUserConfirmation); }
private static void PlatformUnsetInstance() { MacOSCrashes.ResetSharedInstance(); }
static Task PlatformSetEnabledAsync(bool enabled) { MacOSCrashes.SetEnabled(enabled); return(Task.FromResult(default(object))); }
static Task <bool> PlatformIsEnabledAsync() { return(Task.FromResult(MacOSCrashes.IsEnabled())); }