Merge branch 'master' into v-ankubo/save-error-report
# Conflicts: # CHANGELOG.md
This commit is contained in:
Коммит
0639b9925b
|
@ -2,8 +2,11 @@
|
|||
|
||||
## Version 1.10.1 (Under develop)
|
||||
|
||||
* **[Improvement]** Specified minimum cocoapods version in podspec to 1.10.0
|
||||
* **[Improvement]** Mark `(NSString *) crashReportPath;` method as public.
|
||||
|
||||
___
|
||||
|
||||
## Version 1.10.0
|
||||
|
||||
* **[Fix]** Fix error `Undefined symbols for architecture arm64` while building PLCrashReporter for simulator on Xcode 12.4 and higher.
|
||||
|
@ -11,6 +14,8 @@
|
|||
* **[Feature]** Distribute XCFramework via Cocoapods and Carthage. The XCFramework will contain static libs only.
|
||||
* **[Fix]** Include plcrashutil in all release archives
|
||||
|
||||
___
|
||||
|
||||
## Version 1.9.0
|
||||
|
||||
* **[Fix]** Fix `double-quoted` warnings in Xcode 12.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Pod::Spec.new do |spec|
|
||||
spec.cocoapods_version = '>= 1.10'
|
||||
spec.name = 'PLCrashReporter'
|
||||
spec.version = '1.10.0'
|
||||
spec.summary = 'Reliable, open-source crash reporting for iOS, macOS and tvOS.'
|
||||
|
|
51
README.md
51
README.md
|
@ -77,6 +77,8 @@ PLCrashReporter can be added to your app via [CocoaPods](https://guides.cocoapod
|
|||
|
||||
The following example shows a way how to initialize crash reporter. Please note that enabling in-process crash reporting will conflict with any attached debuggers.
|
||||
|
||||
### Objective-c
|
||||
|
||||
```objc
|
||||
@import CrashReporter;
|
||||
|
||||
|
@ -124,6 +126,55 @@ if ([crashReporter hasPendingCrashReport]) {
|
|||
}
|
||||
```
|
||||
|
||||
### Swift
|
||||
|
||||
```swift
|
||||
import CrashReporter
|
||||
|
||||
...
|
||||
|
||||
// It is strongly recommended that local symbolication only be enabled for non-release builds.
|
||||
// Use [] for release versions.
|
||||
let config = PLCrashReporterConfig(signalHandlerType: .mach, symbolicationStrategy: .all)
|
||||
guard let crashReporter = PLCrashReporter(configuration: config) else {
|
||||
print("Could not create an instance of PLCrashReporter")
|
||||
return
|
||||
}
|
||||
|
||||
// Enable the Crash Reporter.
|
||||
do {
|
||||
try crashReporter.enableAndReturnError()
|
||||
} catch let error {
|
||||
print("Warning: Could not enable crash reporter: \(error)")
|
||||
}
|
||||
```
|
||||
|
||||
Checking collected crash report can be done in the following way:
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
### Prerequisites
|
||||
|
|
Загрузка…
Ссылка в новой задаче