Setup and Installation
Overview
Section titled “Overview”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.
Getting Started
Section titled “Getting Started”Obtain Your Application ID
Section titled “Obtain Your Application ID”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.
Installation
Section titled “Installation”To begin using the Secure Privacy Flutter SDK, include the SDK dependency in your project along with some additional dependencies.
- Add the dependency to your
pubspec.yaml:
dependencies: secure_privacy_mobile_consent: ^0.2.2-beta- Run:
flutter pub getInitialization
Section titled “Initialization”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.
Explore the Example App
Section titled “Explore the Example App”Checkout Secure Privacy Flutter SDK - Example App on GitHub! 👉 View Example App