Skip to content

Setup and Installation

The Secure Privacy Flutter SDK allows you to manage user consent easily across Android and iOS platforms. By integrating this SDK, you can ensure compliance with privacy regulations while offering users control over their data preferences.

To use the Secure Privacy Consent Management SDK, you need an Application ID.
Sign up for a free trial at Secure Privacy to get your Application ID.

To begin using the Secure Privacy Flutter SDK, include the SDK dependency in your project along with some additional dependencies.

  1. Add the dependency to your pubspec.yaml:
dependencies:
secure_privacy_mobile_consent: ^0.2.2-beta
  1. Run:
Terminal window
flutter pub get

To initialize the SDK, call the following method with your applicationId in your main widget or app initialization code.

You may also include secondaryApplicationId, which is an optional parameter used to display a secondary consent banner in your app:

final spConsentEngine = SecurePrivacyMobileConsent();
final result = await spMobileConsent.initialiseSDK(
android: SPAuthKey(
applicationId: "YOUR_ANDROID_APPLICATION_ID",
secondaryApplicationId: "YOUR_SECONDARY_ANDROID_APPLICATION_ID",
),
ios: SPAuthKey(
applicationId: "YOUR_IOS_APPLICATION_ID",
secondaryApplicationId: "YOUR_SECONDARY_IOS_APPLICATION_ID",
),
);
if(result.code==200){
// SDK initialised successfully!
}

This will set up and initialise the SDK with your provided applicationId(s) and enable access to its features using the spConsentEngine instance.

Checkout Secure Privacy Flutter SDK - Example App on GitHub! 👉 View Example App