# Mobile SDKs - @breakpilot/consent-sdk ## Übersicht Die Mobile SDKs bieten native Integration fΓΌr iOS, Android und Flutter. ## SDK Übersicht | Platform | Sprache | Min Version | Status | |----------|---------|-------------|--------| | iOS | Swift 5.9+ | iOS 15.0+ | πŸ“‹ Spec | | Android | Kotlin | API 26+ | πŸ“‹ Spec | | Flutter | Dart 3.0+ | Flutter 3.16+ | πŸ“‹ Spec | ## Architektur ``` Mobile SDK β”œβ”€β”€ Core (shared) β”‚ β”œβ”€β”€ ConsentManager β”‚ β”œβ”€β”€ ConsentStorage (Keychain/SharedPrefs) β”‚ β”œβ”€β”€ API Client β”‚ └── Device Fingerprint β”œβ”€β”€ UI Components β”‚ β”œβ”€β”€ ConsentBanner β”‚ β”œβ”€β”€ ConsentSettings β”‚ └── ConsentGate └── Platform-specific β”œβ”€β”€ iOS: SwiftUI + UIKit β”œβ”€β”€ Android: Jetpack Compose + XML └── Flutter: Widgets ``` ## Feature-ParitΓ€t mit Web SDK | Feature | iOS | Android | Flutter | |---------|-----|---------|---------| | Consent Storage | Keychain | SharedPrefs | SecureStorage | | Banner UI | SwiftUI | Compose | Widget | | Settings Modal | βœ“ | βœ“ | βœ“ | | Category Control | βœ“ | βœ“ | βœ“ | | Vendor Control | βœ“ | βœ“ | βœ“ | | Offline Support | βœ“ | βœ“ | βœ“ | | Google Consent Mode | βœ“ | βœ“ | βœ“ | | ATT Integration | βœ“ | - | βœ“ (iOS) | | TCF 2.2 | βœ“ | βœ“ | βœ“ | ## Installation ### iOS (Swift Package Manager) ```swift // Package.swift dependencies: [ .package(url: "https://github.com/breakpilot/consent-sdk-ios.git", from: "1.0.0") ] ``` ### Android (Gradle) ```kotlin // build.gradle.kts dependencies { implementation("com.breakpilot:consent-sdk:1.0.0") } ``` ### Flutter ```yaml # pubspec.yaml dependencies: breakpilot_consent_sdk: ^1.0.0 ``` ## Quick Start ### iOS ```swift import BreakpilotConsentSDK // AppDelegate.swift ConsentManager.shared.configure( apiEndpoint: "https://consent.example.com/api/v1", siteId: "site_abc123" ) // ContentView.swift (SwiftUI) struct ContentView: View { @EnvironmentObject var consent: ConsentManager var body: some View { VStack { if consent.hasConsent(.analytics) { AnalyticsView() } } .consentBanner() } } ``` ### Android ```kotlin import com.breakpilot.consent.ConsentManager import com.breakpilot.consent.ui.ConsentBanner // Application.kt class MyApp : Application() { override fun onCreate() { super.onCreate() ConsentManager.configure( context = this, apiEndpoint = "https://consent.example.com/api/v1", siteId = "site_abc123" ) } } // MainActivity.kt (Jetpack Compose) @Composable fun MainScreen() { val consent = ConsentManager.current if (consent.hasConsent(ConsentCategory.ANALYTICS)) { AnalyticsComponent() } ConsentBanner() } ``` ### Flutter ```dart import 'package:breakpilot_consent_sdk/consent_sdk.dart'; // main.dart void main() async { WidgetsFlutterBinding.ensureInitialized(); await ConsentManager.configure( apiEndpoint: 'https://consent.example.com/api/v1', siteId: 'site_abc123', ); runApp(MyApp()); } // Widget class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return ConsentProvider( child: MaterialApp( home: Scaffold( body: Column( children: [ ConsentGate( category: ConsentCategory.analytics, child: AnalyticsWidget(), placeholder: Text('Analytics nicht aktiviert'), ), ], ), bottomSheet: ConsentBanner(), ), ), ); } } ``` ## Dateien Siehe die einzelnen Platform-SDKs: - [iOS SDK Spec](./ios/README.md) - [Android SDK Spec](./android/README.md) - [Flutter SDK Spec](./flutter/README.md)