Last updated:
0 purchases
next14cmp flutter
Next14 CMP for Flutter #
Installation #
add {next14cmpFlutter} as a dependency in your pubspec.yaml file.
copied to clipboard
How to use #
Initialization #
The Next14 CMP SDK need to retrieves configurations at startup which contains
all the data needed to present the consent screen to the user.
The initialization is done via the start method.
final _next14cmpFlutterPlugin = Next14cmpFlutter();
await _next14cmpFlutterPlugin
.start("<YOUR API KEY>", 180)
.then((value) => ... );
copied to clipboard
Parameters
Parameter
Description
Required
apiKey
The application unique identifier on the CMP platform
Yes
consentPreferenceValidityDays
the number of days since the last time the user has given consent, after which the request for consent is presented again to the user
No
Display Consent Screen #
After the SDK has been initialized, the application should call the
shouldPresentCMP method to check if the consent screen need to be displayed to
the user, and if so it should call the present method.
The present method takes an optional callback that will be
invoked when the user has expressed his consent and the consent UI has been
fully dismissed.
_next14cmpFlutterPlugin
.shouldPresent()
.then((value) {
if (value) {
_next14cmpFlutterPlugin.present();
}
});
copied to clipboard
Parameter
Description
Required
gdprApplies
whether the GDPR applies to the current user or not
No
callback
an optional callback to be notified when the consent screen is closed
No
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.