Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmplibrary/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION_NAME = 7.15.4
VERSION_NAME = 7.15.5
2 changes: 1 addition & 1 deletion cmplibrary/release_note.txt
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface SpConsentLib {
*/
val dismissMessageOnBackPress: Boolean

var cleanUserDataOnError: Boolean

/**
* Load the First Layer Message (FLM)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<MessageToDisplay> = ArrayDeque(emptyList())
Expand Down Expand Up @@ -365,6 +366,10 @@ class SpConsentLibMobileCore(
pendingActions = 0
messagesToDisplay = ArrayDeque(emptyList())

if (cleanUserDataOnError) {
clearLocalData()
}

when (error) {
is NoIntentFoundForUrl -> {
spClient.onNoIntentActivitiesFound(error.url ?: "")
Expand Down