Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README with the UserDefaultsReporter changes #172

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ The library allows to easily attach the Diagnostics Report as an attachment to t
- App metadata
- System metadata
- System logs divided per session
- UserDefaults
- [x] Possibility to filter out sensitive data using a `DiagnosticsReportFilter`
- [x] A custom `DiagnosticsLogger` to add your own logs
- [x] Smart insights like _"⚠️ User is low on storage"_ and *"✅ User is using the latest app version"*
Expand Down Expand Up @@ -132,11 +131,16 @@ func send(report: DiagnosticsReport) {
}
```

### Using a custom UserDefaults type
Simply set your user defaults instance by making use of:
### Using a UserDefaultsReporter
In order to use `UserDefaultsReporter`, you need to set instantiate it with the desired `UserDefaults` instance together with all the keys you would like to read, and use it in `DiagnosticsReporter.create(filename:using:filters:smartInsightsProvider)` to create a `DiagnosticsReport`.
raphkoebraam marked this conversation as resolved.
Show resolved Hide resolved

```swift
UserDefaultsReporter.userDefaults = ..
let userDefaultsReporter = UserDefaultsReporter(
userDefaults: UserDefaults(suiteName: "a.userdefaults.instance"),
keys: ["key_1"]
)

let diagnosticsReport = DiagnosticsReporter.create(using: [userDefaultsReporter])
```

### Filtering out sensitive data
Expand Down