Secure Privacy Flutter SDK

The Secure Privacy Flutter SDK provides a unified way to collect, manage, and signal user consent across Android and iOS platforms.
It exposes a simple Flutter API for consent handling, making your app compliant with GDPR, CCPA, and other privacy regulations.


Installation

Add the dependency in your pubspec.yaml:

dependencies:
  secure_privacy_mobile_consent: ^0.0.1-alpha

Run:

flutter pub get

⚙️ Platform Setup

Android

  1. Open your app-level build.gradle and update the following:
android {
    compileSdkVersion 35

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 35
    }
}
  1. Ensure your app has Internet permission:
<uses-permission android:name="android.permission.INTERNET"/>
  1. Add the SDK repository if not already present:
allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

iOS

  1. Minimum supported version:

Update your ios/Podfile:

platform :ios, '14.0'
  1. Install pods:
cd ios
pod install
  1. Ensure your Xcode project is configured to use Swift.

🚀 Usage

Initialize SDK

Import the package:

import 'package:secure_privacy_mobile_consent/secureprivacy_mobile_consent.dart';

Call initialization as early as possible (e.g., in main()):

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await SPMobileConsent.initialize(key);

  runApp(MyApp());
}

await SPMobileConsent.showConsentBanner();

📚 Documentation


📝 License

© Secure Privacy. All rights reserved.