KSCrash icon indicating copy to clipboard operation
KSCrash copied to clipboard

Get Reports in Apple Format

Open AlokRao opened this issue 10 years ago • 5 comments

In iOS, we can get all crash reports which is in Library/Cache ... But that is saved in JSON format. Is there any way to get reports in Apple format or save it in Apple format. I am not using any Installation classes. I am just uploading those reports to our own server.

AlokRao avatar Jun 03 '14 06:06 AlokRao

Take a look at KSCrashReportFilterAppleFmt

yvasileuski avatar Jun 03 '14 07:06 yvasileuski

@yvasileuski: Yeah I just searched it. There toAppleFmt function helped me. But that is private function. I made it as public function. Thank you. If you know any better solution pls comment.

AlokRao avatar Jun 03 '14 10:06 AlokRao

You should use filters to decode reports, e.g. id<KSCrashReportFilter> filter = [KSCrashReportFilterAppleFmt filterWithReportStyle:KSAppleReportStyleSymbolicatedSideBySide];

KSCrashReportStore *crashReportStore = [[KSCrash sharedInstance] crashReportStore];
NSDictionary *reportWithID = [crashReportStore reportWithID:self.reportID];
NSArray *reports = @[reportWithID];
[filter filterReports:reports
              onCompletion:^(NSArray *filteredReports, BOOL completed, NSError *error) {...}

yvasileuski avatar Jun 03 '14 12:06 yvasileuski

I assume this formats the JSON files to Apple format? I am not currently seeing any difference with the above code.

leekaiwei avatar Jul 25 '14 14:07 leekaiwei

Worked like a charm Thanks @yvasileuski

ghost avatar Mar 27 '20 12:03 ghost