Platform SDKs / Flutter
Flutter
Install and configure the Nosmai SDK in a Flutter app.
Install
Add the plugin to pubspec.yaml, then flutter pub get. It wraps the native iOS + Android SDKs — the camera, frames and inference stay native; only results cross to Dart.
dependencies:
nosmai_moderation_sdk: ^1.0.0
Android — add the native library to your host app. The Android SDK ships as an AAR your app bundles directly:
- Download
nosmai-detection.aarfrom the Android releases. - Put it in
android/app/libs/nosmai-detection.aar. - In
android/app/build.gradle.kts:
android {
defaultConfig {
minSdk = 24
ndk { abiFilters += "arm64-v8a" }
}
}
dependencies {
implementation(files("libs/nosmai-detection.aar"))
}
iOS needs no extra step — pod install pulls the native SDK with the plugin.
Configure
Initialize once with your license key. It runs natively on a background thread.
import 'package:nosmai_moderation_sdk/nosmai_moderation_sdk.dart';
final res = await NosmaiModeration.initialize('NOSMAI-XXXX');
if (!res.success) debugPrint('Nosmai init failed: ${res.error}');
Requirements
- Flutter 3 or later
- Android
minSdk 24(arm64-v8a); iOS 14+ (arm64) - Camera permission in
AndroidManifest.xml/NSCameraUsageDescriptioninInfo.plistfor live moderation - iOS App Store: set
ITSAppUsesNonExemptEncryption=NOinInfo.plist(the SDK only encrypts its own bundled models — export-compliance exempt) - Distribute Android as an App Bundle (AAB) — the SDK ships
arm64-v8aonly (won’t run on x86_64 emulators)
NOTE
Next: Moderation · Flutter — image, video, text and live usage.