> For the complete documentation index, see [llms.txt](https://docs.sfbx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfbx.io/configuration/step-3-notice-implementation-web-app-tv/flutter.md).

# Flutter

`unified_sdk` is the official Flutter plugin of the AppConsent Unified SDK. It shows the consent notice and gives you the user's consent (IAB TCF v2, Google Consent Mode v2) on Android and iOS, through one Dart API.

**→** [**unified\_sdk on pub.dev**](https://pub.dev/packages/unified_sdk): installation, integration guide, full API, migration from `appconsent_clear` and troubleshooting are in the package README.

### Requirements

|            |                                                                      |
| ---------- | -------------------------------------------------------------------- |
| Android    | minSdk 21                                                            |
| iOS        | 15.0, Xcode 27                                                       |
| AppConsent | your appKey, generated when you create your notice in your dashboard |

### Install

```sh
flutter pub add unified_sdk
```

Android needs no extra setup. For iOS, see iOS setup.

#### iOS setup

The plugin requires **iOS 15.0** and **Xcode 27**.

1. **Deployment target.** Set iOS 15.0 in `ios/Podfile`:

   ```ruby
   platform :ios, '15.0'
   ```

   and on the Runner target (Xcode: *Runner > General > Minimum Deployments*).
2. **Other pods (Xcode 27).** Xcode 27 builds nothing below iOS 15.0. Raise every pod in the `post_install` block of `ios/Podfile`:

   ```ruby
   post_install do |installer|
     installer.pods_project.targets.each do |target|
       flutter_additional_ios_build_settings(target)
       target.build_configurations.each do |config|
         config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
       end
     end
   end
   ```
3. **App Tracking Transparency.** If your notice uses ATT, add a usage description to `ios/Runner/Info.plist`. iOS terminates any app that requests tracking authorization without it:

   ```xml
   <key>NSUserTrackingUsageDescription</key>
   <string>This identifier will be used to deliver personalized ads to you.</string>
   ```
4. Run `pod install` from the `ios` folder, or simply build with `flutter run`.

### Quick start

```dart
import 'package:unified_sdk/unified_sdk.dart';

final sdk = UnifiedSdk();

await sdk.initialize('YOUR_APP_KEY');   // as early as possible
await sdk.presentNotice();              // shows the notice only if consent is required
```

### Release notes

See the [changelog on pub.dev](https://pub.dev/packages/unified_sdk/changelog). Native SDK changes are detailed in the [Android](https://docs.sfbx.io/help/release-notes/android/unifiedsdk) and [iOS](https://docs.sfbx.io/help/release-notes/ios) release notes.
