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
- Open your app-level
build.gradleand update the following:
android {
compileSdkVersion 35
defaultConfig {
minSdkVersion 23
targetSdkVersion 35
}
}
- Ensure your app has Internet permission:
<uses-permission android:name="android.permission.INTERNET"/>
- Add the SDK repository if not already present:
allprojects {
repositories {
google()
mavenCentral()
}
}
iOS
- Minimum supported version:
Update your ios/Podfile:
platform :ios, '14.0'
- Install pods:
cd ios
pod install
- 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());
}
Show Consent Banner
await SPMobileConsent.showConsentBanner();
📚 Documentation
📝 License
© Secure Privacy. All rights reserved.