From 15f8967c0125cf7cbf74025466645b9db999ebac Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 27 Aug 2025 10:28:21 +0200 Subject: [PATCH 1/4] add `cleanUserDataOnError` implementation --- .../main/java/com/sourcepoint/cmplibrary/SpConsentLib.kt | 2 ++ .../com/sourcepoint/cmplibrary/SpConsentLibMobileCore.kt | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLib.kt b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLib.kt index 245e6d78e..e1291ec6b 100644 --- a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLib.kt +++ b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLib.kt @@ -16,6 +16,8 @@ interface SpConsentLib { */ val dismissMessageOnBackPress: Boolean + var cleanUserDataOnError: Boolean + /** * Load the First Layer Message (FLM) */ diff --git a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLibMobileCore.kt b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLibMobileCore.kt index 0589fbf46..f61001b2a 100644 --- a/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLibMobileCore.kt +++ b/cmplibrary/src/main/java/com/sourcepoint/cmplibrary/SpConsentLibMobileCore.kt @@ -67,7 +67,8 @@ class SpConsentLibMobileCore( private val coordinator: ICoordinator, private val connectionManager: ConnectionManager, private val spClient: SpClient, - override val dismissMessageOnBackPress: Boolean = true + override val dismissMessageOnBackPress: Boolean = true, + override var cleanUserDataOnError: Boolean = false ) : SpConsentLib, SPMessageUIClient { private var pendingActions: Int = 0 private var messagesToDisplay: ArrayDeque = ArrayDeque(emptyList()) @@ -365,6 +366,10 @@ class SpConsentLibMobileCore( pendingActions = 0 messagesToDisplay = ArrayDeque(emptyList()) + if (cleanUserDataOnError) { + clearLocalData() + } + when (error) { is NoIntentFoundForUrl -> { spClient.onNoIntentActivitiesFound(error.url ?: "") From e5a42ba13cc844562a74c0e94ed5456214cfdcb5 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 27 Aug 2025 10:37:08 +0200 Subject: [PATCH 2/4] Update `README.md` --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f7ca68b1b..22999f1a7 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,8 @@ The `onError` callback can return the following responses: | `RequestFailedException` | Request failed due to a 4XX or 5XX error | | `InvalidRequestException` | Request is invalid | +By default, the SDK preserves all user consent data in case of OnError event is called. Set `spConsentLib.cleanUserDataOnError` flag to true after you initialize `spConsentLib` if you wish to opt-out from this behavior. This may cause a consent message to be shown again, depending on your scenario. + ## Loading the First Layer Message In order to show the FLM, the method `spConsentLib.loadMessage()` has to be called. From 119146ccacf601a453cbcd304938acab3f7e44c6 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 28 Aug 2025 16:06:20 +0200 Subject: [PATCH 3/4] Update `release_note.txt` --- cmplibrary/release_note.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmplibrary/release_note.txt b/cmplibrary/release_note.txt index 7a0ef84aa..6f6d20457 100644 --- a/cmplibrary/release_note.txt +++ b/cmplibrary/release_note.txt @@ -1 +1 @@ -* removed `coreLibraryDesugaring`. [#872](https://github.com/SourcePointUSA/ios-cmp-app/pull/872) +* Expose opt out setting `cleanUserDataOnError` to clear user data on error [#873](https://github.com/SourcePointUSA/android-cmp-app/pull/873) From ad637081064ef97837fad6dbd01e618dbae40892 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 28 Aug 2025 16:06:27 +0200 Subject: [PATCH 4/4] Bump`VERSION_NAME` to `7.15.5` --- cmplibrary/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmplibrary/gradle.properties b/cmplibrary/gradle.properties index 8c52a2401..aada79908 100644 --- a/cmplibrary/gradle.properties +++ b/cmplibrary/gradle.properties @@ -1 +1 @@ -VERSION_NAME = 7.15.4 +VERSION_NAME = 7.15.5