Skip to content

Commit

Permalink
Merge pull request #172 from WeTransfer/chore/raph/tmob-5314/privacy-…
Browse files Browse the repository at this point in the history
…manifest-update

Update README with the `UserDefaultsReporter` changes
  • Loading branch information
raphkoebraam committed Apr 17, 2024
2 parents 2b6a279 + d7eb8c6 commit 9fac859
Showing 1 changed file with 8 additions and 4 deletions.
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`.

```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

0 comments on commit 9fac859

Please sign in to comment.