Files
breakpilot-compliance/consent-sdk/src/mobile
Benjamin Boenisch 4435e7ea0a Initial commit: breakpilot-compliance - Compliance SDK Platform
Services: Admin-Compliance, Backend-Compliance,
AI-Compliance-SDK, Consent-SDK, Developer-Portal,
PCA-Platform, DSMS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:47:28 +01:00
..

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)

// Package.swift
dependencies: [
    .package(url: "https://github.com/breakpilot/consent-sdk-ios.git", from: "1.0.0")
]

Android (Gradle)

// build.gradle.kts
dependencies {
    implementation("com.breakpilot:consent-sdk:1.0.0")
}

Flutter

# pubspec.yaml
dependencies:
  breakpilot_consent_sdk: ^1.0.0

Quick Start

iOS

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

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

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: