Beispiel #1
0
 public static void SentErrorReportNativeFunc(IntPtr report)
 {
     if (SentErrorReport != null)
     {
         ErrorReport errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
         SentErrorReport(errorReport);
     }
 }
 public static void FailedToSendErrorReportNativeFunc(IntPtr report)
 {
     if (FailedToSendErrorReport != null)
     {
         ErrorReport errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
         FailedToSendErrorReport(errorReport);
     }
 }
Beispiel #3
0
 public static void FailedToSendErrorReportNativeFunc(IntPtr report, IntPtr error)
 {
     if (FailedToSendErrorReport != null)
     {
         var errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
         var exception   = NSErrorHelper.Convert(error);
         FailedToSendErrorReport(errorReport, exception);
     }
 }
        public static IntPtr GetErrorAttachmentsNativeFunc(IntPtr report)
        {
            if (GetErrorAttachmentsHandler == null)
            {
                return(IntPtr.Zero);
            }
            var errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
            var logs        = GetErrorAttachmentsHandler(errorReport);

            return(NativeObjectsConverter.ToNativeAttachments(logs));
        }
Beispiel #5
0
 public static bool ShouldProcessErrorReportNativeFunc(IntPtr report)
 {
     if (shouldProcessReportHandler != null)
     {
         ErrorReport errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
         return(shouldProcessReportHandler(errorReport));
     }
     else
     {
         return(true);
     }
 }
Beispiel #6
0
        public static IntPtr GetErrorAttachmentsNativeFunc(IntPtr report)
        {
            if (getErrorAttachmentsHandler != null)
            {
                var errorReport = CrashesInternal.GetErrorReportFromIntPtr(report);
                var logs        = getErrorAttachmentsHandler(errorReport);
                var nativeLogs  = new List <IntPtr>();
                foreach (var errorAttachmetLog in logs)
                {
                    IntPtr nativeLog = IntPtr.Zero;
                    if (errorAttachmetLog.Type == ErrorAttachmentLog.AttachmentType.Text)
                    {
                        nativeLog = app_center_unity_crashes_get_error_attachment_log_text(errorAttachmetLog.Text, errorAttachmetLog.FileName);
                    }
                    else
                    {
                        nativeLog = app_center_unity_crashes_get_error_attachment_log_binary(errorAttachmetLog.Data, errorAttachmetLog.Data.Length, errorAttachmetLog.FileName, errorAttachmetLog.ContentType);
                    }
                    nativeLogs.Add(nativeLog);
                }

                IntPtr log0 = IntPtr.Zero;
                if (nativeLogs.Count > 0)
                {
                    log0 = nativeLogs[0];
                }
                IntPtr log1 = IntPtr.Zero;
                if (nativeLogs.Count > 1)
                {
                    log1 = nativeLogs[1];
                }
                return(app_center_unity_create_error_attachments_array(log0, log1));
            }
            else
            {
                return(IntPtr.Zero);
            }
        }