firebase / firebase/firebase-ios-sdk

FR: Add an API to generate plain text crash report.

Open
#9,853 0 comments 2 reactions 0 assignees View on GitHub
api: crashlytics type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 14h
Merged PRs (30d)
72

Description

### Feature proposal

* Firebase Component: Crashlytics

Describe your use case and/or feature request here.

The [plcrashreporter](https://github.com/microsoft/plcrashreporter#example) has APIs to allow us to get the crash report as plain string, I was wondering if Crashlytics can provide us something similar.

```swift
// Try loading the crash report.
if crashReporter.hasPendingCrashReport() {
do {
let data = try crashReporter.loadPendingCrashReportDataAndReturnError()

// Retrieving crash reporter data.
let report = try PLCrashReport(data: data)

// We could send the report from here, but we'll just print out some debugging info instead.
if let text = PLCrashReportTextFormatter.stringValue(for: report, with: PLCrashReportTextFormatiOS) {
print(text)
} else {
print("CrashReporter: can't convert report to text")
}
} catch let error {
print("CrashReporter failed to load and parse with error: \(error)")
}
}

// Purge the report.
crashReporter.purgePendingCrashReport()
```

### Use Case

We are planing to build our own crash reporter for our customers, but a lot of them already using FirebaseCrashlytics (we don't want to stop them using it), and for now It is not recommended to use multiple crash reporters in iOS, so instead of creating our own crash/exception/signal handler, we want to get the crash report directly from FirebaseCrashlytics and send it to our server.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.