For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrate from 0.3.0-beta01 to 6.0.0

Impact of Migration

Version 0.3.0-beta01 was a release that paved the way for version 6.0.0.

During the development of version 6.0.0, improvements were made and some breaking changes were implemented.

What are the implications for your application?

There are two major changes in this new version.

The SDK Configuration

The first is the “io.sfbx.appconsent.unifiedsdk.Configuration” object. The forceGdpr field has been removed (this field was no longer in use—therefore, there is no impact on SDK usage).

The initialize callback onError

The onCmpOnError callback in the SDK’s initialization method

public final fun initialize(
context: Context,
configuration: Configuration,
onCmpReady: (Appconsent) -> Unit,
onCmpOnError: (AppconsentExceptions) -> Unit
): Unit

A parameter has been added to the callback to provide more information about the type of error that occurred during the initialization phase

AppconsentExceptions - The new sealed class

This new sealed class implements various subclasses of RuntimeException, providing a wealth of information about any exceptions that may occur while using the SDK.

We recommend that you explicitly implement exception handling so that you can, for example, stop the SDK initialization or retry it.

In the case of an exception of type: AppConsentWebviewError, this error will inform you that the webview used to process your consent could not be instantiated or is not fully functional.

For example, it’s possible that one of your users’ devices doesn’t have a WebView, or that at some point the module was disabled or is currently being updated. In this case, the SDK won’t be able to initialize until the module is available again.

An exception of type AppConsentAppKeyXXX will indicate a problem with your AppKey; please review the error and contact support if necessary.

What to do if an error occurs

Try calling the SFBX.initialize(...) method again, and if it still returns an error, stop using it until the next time you start your application.

Last updated