From 981d4f3d31fbab877322e32efd578b84268c3655 Mon Sep 17 00:00:00 2001 From: Raphael Silva <5387088+peagasilva@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:46:45 +0200 Subject: [PATCH 1/2] Update README with the `UserDefaultsReporter` changes --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0bf55c..56d93c3 100644 --- a/README.md +++ b/README.md @@ -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"* @@ -133,10 +132,15 @@ func send(report: DiagnosticsReport) { ``` ### Using a custom UserDefaults type -Simply set your user defaults instance by making use of: +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 From d7eb8c6c4eefb77234115b3b15abf7817b67d137 Mon Sep 17 00:00:00 2001 From: Raphael Silva <5387088+peagasilva@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:18:02 +0200 Subject: [PATCH 2/2] Update section title for `UserDefaultsReporter` usage description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56d93c3..2ef0490 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ func send(report: DiagnosticsReport) { } ``` -### Using a custom UserDefaults type +### 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