I am calling handle_crash_report from application_did_finish_launching_with options. Also implemented handle_crash_report. And now I am sending the crash logs via mail. Here are the codes I am using.
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
if (mailClass != nil) {
MFMailComposeViewController *picker1 = [[MFMailComposeViewController alloc] init];
picker1.mailComposeDelegate = self;
picker1.modalPresentationStyle = UIModalPresentationFormSheet;
[picker1 setSubject:@"log files"];
// Set the recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"telekomsrbija.android@gmail.com"];
[picker1 setToRecipients:toRecipients];
//First File
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *fileName = [documentsDirectory stringByAppendingPathComponent:@"debug_log.txt"];
NSData *myNoteData = [NSData dataWithContentsOfFile:fileName];
if ([myNoteData length])
[picker1 addAttachmentData:myNoteData mimeType:@"text/plain" fileName:@"debug_log.txt"];
and then I am checking whether CrashHelper has crashReportPending. which has got this code.
if ([CrashHelper hasCrashReportPending]) {
NSData* crashData = [NSData dataWithContentsOfFile:[CrashHelper sharedCrashHelper].getCrashPath];
[picker1 addAttachmentData:crashData mimeType:@"text/plain" fileName:@"LastCrashReports.txt"];
}
NSString *emailBody = @"I am attaching my file!";
[picker1 setMessageBody:emailBody isHTML:NO];
if([mailClass canSendMail]) {
[self.navigationController presentViewController:picker1 animated:YES completion:nil];
}
}
I am getting the mail but not symbolicated code. I am attaching the snapshot.