public static string TrackException(AndroidJavaObject exception, IDictionary <string, string> properties, ErrorAttachmentLog[] attachments) { var javaProperties = JavaStringMapHelper.ConvertToJava(properties); var javaAttachments = JavaObjectsConverter.ToJavaAttachments(attachments); return(_wrapperSdkExceptionManager.CallStatic <string>("trackException", exception, javaProperties, javaAttachments)); }
public bool shouldProcess(AndroidJavaObject report) { var handler = shouldProcessErrorReportHandler; if (handler != null) { return(handler.Invoke(JavaObjectsConverter.ConvertErrorReport(report))); } return(true); }
public void onSendingSucceeded(AndroidJavaObject report) { var handlers = SentErrorReport; if (handlers != null) { var errorReport = JavaObjectsConverter.ConvertErrorReport(report); handlers.Invoke(errorReport); } }
public void onSendingFailed(AndroidJavaObject report, AndroidJavaObject exception) { var handlers = FailedToSendErrorReport; if (handlers != null) { var errorReport = JavaObjectsConverter.ConvertErrorReport(report); var failCause = JavaObjectsConverter.ConvertException(exception); handlers.Invoke(errorReport, failCause); } }
public AndroidJavaObject getErrorAttachments(AndroidJavaObject report) { if (GetErrorAttachmentsHandler != null) { var logs = GetErrorAttachmentsHandler(JavaObjectsConverter.ConvertErrorReport(report)); return(JavaObjectsConverter.ToJavaAttachments(logs)); } else { return(null); } }
public static AppCenterTask <ErrorReport> GetLastSessionCrashReportAsync() { var future = _crashes.CallStatic <AndroidJavaObject>("getLastSessionCrashReport"); var javaTask = new AppCenterTask <AndroidJavaObject>(future); var errorReportTask = new AppCenterTask <ErrorReport>(); javaTask.ContinueWith(t => { var errorReport = JavaObjectsConverter.ConvertErrorReport(t.Result); errorReportTask.SetResult(errorReport); }); return(errorReportTask); }
public AndroidJavaObject getErrorAttachments(AndroidJavaObject report) { if (GetErrorAttachments != null) { var logs = GetErrorAttachments(JavaObjectsConverter.ConvertErrorReport(report)); var nativeLogs = new List <AndroidJavaObject>(); foreach (var errorAttachmetLog in logs) { AndroidJavaObject nativeLog = null; if (errorAttachmetLog.Type == ErrorAttachmentLog.AttachmentType.Text) { nativeLog = AttachmentWithText(errorAttachmetLog.Text, errorAttachmetLog.FileName); } else { nativeLog = AttachmentWithBinary(errorAttachmetLog.Data, errorAttachmetLog.FileName, errorAttachmetLog.ContentType); } nativeLogs.Add(nativeLog); } var javaList = new AndroidJavaObject("java.util.LinkedList"); if (nativeLogs.Count > 0) { javaList.Call("addLast", nativeLogs[0]); } if (nativeLogs.Count > 1) { javaList.Call("addLast", nativeLogs[1]); } return(javaList); } else { return(null); } }
public static void SendErrorAttachments(string errorReportId, ErrorAttachmentLog[] attachments) { var nativeAttachments = JavaObjectsConverter.ToJavaAttachments(attachments); _wrapperSdkExceptionManager.CallStatic("sendErrorAttachments", errorReportId, nativeAttachments); }
public static ErrorReport BuildHandledErrorReport(string errorReportId) { var nativeErrorReport = _wrapperSdkExceptionManager.CallStatic <AndroidJavaObject>("buildHandledErrorReport", AndroidUtility.GetAndroidContext(), errorReportId); return(JavaObjectsConverter.ConvertErrorReport(nativeErrorReport)); }