flutter_privacy_doctor

pub.dev version pub points Dart CI License: MIT

Audit Flutter dependencies for iOS PrivacyInfo.xcprivacy compliance and auto-generate App Store Privacy Labels + Google Play Data Safety forms.


The Problem

Every time you ship a Flutter app, you must:

  1. Verify that every native iOS SDK ships a PrivacyInfo.xcprivacy file — Apple will reject your app if a bundled SDK is missing one.
  2. Manually fill out App Store Privacy Nutrition Labels — guessing which categories apply to each SDK you use.
  3. Manually fill out Google Play Data Safety forms — cross-referencing every permission with what it maps to in Play Console.

There is no built-in Flutter tool for any of this. The Flutter team acknowledged this gap publicly. Developers currently do it by hand — visiting every pub.dev page one by one.

flutter_privacy_doctor automates all three steps.


Features

Feature Description
🔍 Manifest checker Scans every native iOS/macOS dependency for PrivacyInfo.xcprivacy across 3 detection tiers
🍎 App Store label draft Pre-fills Apple Privacy Nutrition Label categories for 40+ known SDKs
🤖 Play Store form draft Pre-fills Google Play Data Safety categories for 40+ known SDKs
📋 Android permissions audit Maps AndroidManifest.xml permissions to exact Play Store Data Safety tick-boxes
🔬 Required Reason API heuristic Scans native .swift / .m / .h source for symbols that require a manifest entry
📄 Markdown export Saves the full draft report as a Markdown file for your release checklist
🚦 CI gate Exit code 1 when manifests are missing — block the pipeline before you ship
🎯 JSON output Machine-readable output for dashboards and custom tooling

⚠️ This tool produces a best-effort draft — it is NOT a legal compliance determination. Always verify final answers against your app's actual runtime behavior before submitting to the App Store or Play Console.


Installation

dart pub global activate flutter_privacy_doctor

Run flutter pub get inside your Flutter project first so pubspec.lock and .dart_tool/package_config.json are up to date.


Quick Start

# cd into your Flutter project
cd my_flutter_app

# Run the full privacy audit
flutter_privacy_doctor

The tool reads your dependencies, runs all three checks, and prints a structured, color-coded action plan.


Usage

Sub-commands — run one check at a time

flutter_privacy_doctor manifests              # Step 1: iOS manifest check only
flutter_privacy_doctor data-labels            # Step 2: App Store & Play Store labels only
flutter_privacy_doctor android-permissions    # Step 3: Android permissions cross-check only

All options

Flag / Option Description
--export=<path>.md Save the full draft report to a Markdown file
--json Machine-readable JSON output (for CI pipelines and dashboards)
--fail-on-missing-manifest Exit with code 1 if any native plugin is missing a manifest
--ignore=pkg1,pkg2 Skip specific packages by name
-p <dir> / --project <dir> Flutter project root (default: current directory)
-h / --help Show usage information

Export Markdown report

flutter_privacy_doctor --export=docs/privacy_report.md

Saves a self-contained Markdown file you can commit alongside your release checklist.

CI/CD pipeline gate

Add to your GitHub Actions, Bitrise, or Codemagic pipeline:

- name: Privacy manifest gate
  run: |
    dart pub global activate flutter_privacy_doctor
    flutter_privacy_doctor manifests --fail-on-missing-manifest

Exits with code 1 if any native iOS plugin is missing a PrivacyInfo.xcprivacy file, blocking the build before you submit.

JSON output for dashboards

flutter_privacy_doctor --json > privacy_audit.json

Sample Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍 flutter_privacy_doctor — Pre-Release Privacy Audit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Scanning your dependencies for App Store & Play Store
   privacy compliance issues...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Step 1 of 3 — iOS Privacy Manifest Check
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ firebase_analytics 10.7.4 — Privacy manifest found. Nothing to do.

✅ shared_preferences 2.2.3 — Privacy manifest found.
   ⚠️  Heads up: This plugin uses sensitive iOS APIs.
       Double-check its manifest covers all declared APIs.

❌ flutter_facebook_auth 6.0.0 — Privacy manifest MISSING.
   🚨 Action required:
       Option 1: Update to a newer version (check pub.dev).
       Option 2: Contact the plugin author and ask them to add it.
       Option 3: Add it manually to your app's own manifest.
       👉 https://pub.dev/packages/flutter_facebook_auth

❓ my_custom_plugin 1.0.0 — Could not check automatically.
   👉 Open this link and check if a privacy manifest exists:
      https://pub.dev/packages/my_custom_plugin

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 iOS Manifest Results:
   ✅ 2 plugins — Good to go
   ❌ 1 plugins — Need a privacy manifest (action required)
   ❓ 1 plugins — Could not check automatically (verify manually)

💡 Tip: Fix the ❌ ones first — those can cause App Store rejection.

✅ Audit complete. Good luck with your release! 🚀

How It Works

Three-tier manifest detection

For each native iOS/macOS plugin, the tool checks in priority order:

Tier 1 — Local file scan
  Inspects the package in ~/.pub-cache for any .xcprivacy file
  Result: definitive ✅ (the file exists in your installed version)

Tier 2 — Known database
  Checks bundled known_privacy_manifest_status.json (57 packages)
  Result: ✅ or ❌ with the exact version when the manifest was added

Tier 3 — Unknown
  Not in database, no local file found
  Result: ❓ with a direct pub.dev link for manual review

Federated plugin support: Packages like url_launcher_ios and shared_preferences_foundation resolve correctly to their parent database entry — no false unknowns for federated plugins.

Android-only plugins excluded: Packages like google_sign_in_android and shared_preferences_android are automatically skipped — they have no iOS code and need no manifest.

Required Reason API heuristic

Scans native source (.swift, .m, .mm, .h) for symbols Apple classifies as Required Reason APIs:

Symbol API Category
NSUserDefaults, UserDefaults User defaults storage
NSFileCreationDate, NSFileModificationDate File timestamps
NSFileSystemFreeSize, volumeAvailableCapacityForImportantUsage Disk space
systemUptime, NSProcessInfoThermalState System boot time
activeInputModes Active keyboard

SDK data collection database

The bundled known_sdk_data_collection.json maps 40 popular SDKs to the exact category names used in both the App Store and Play Store forms — so you get precise tick-box instructions, not guesswork.


Bundled SDK Coverage

iOS Privacy Manifest Status

57 packages tracked, including:

  • Full Firebase suite (core, analytics, crashlytics, messaging, auth, firestore, storage, remote config, database, performance, in-app messaging)
  • Google packages (google_sign_in, google_maps_flutter, google_mobile_ads)
  • Flutter team packages (shared_preferences, path_provider, url_launcher, webview_flutter, in_app_purchase, share_plus)
  • Popular third-party (Sentry, Facebook Auth, flutter_stripe, RevenueCat, OneSignal, AppsFlyer, Adjust, Mixpanel, Amplitude)

Data Collection Labels (40 SDKs)

SDK Collects Used for tracking
Firebase Analytics Usage Data, Device ID Yes
Firebase Crashlytics Crash Data, Device ID No
Firebase Messaging Device ID No
Firebase Auth User ID, Email No
Google Mobile Ads Device ID, Advertising Data Yes
Sentry Crash Data, Device ID No
Google Sign-In Email, Name, User ID No
Geolocator Precise Location Yes
Flutter Facebook Auth User ID, Device ID, Email Yes
AppsFlyer Device ID, Usage Data Yes
Adjust Device ID, Usage Data Yes
Branch.io Device ID, Usage Data Yes
RevenueCat Purchase History, Device ID No
Stripe Financial Info, Email No
Amplitude Usage Data, Device ID No
Mixpanel Usage Data, Device ID No
Intercom Name, Email, Usage Data No
OneSignal Device ID No
Braze Name, Email, Device ID No
Webview Flutter Browsing History No
… and 20 more

Contributing

The long-term value of this tool is in keeping both databases current with each SDK's published privacy documentation. Contributions are welcome.

Adding a new SDK

lib/src/services/known_privacy_manifest_status.json — add an iOS manifest entry:

{
  "package": "my_plugin",
  "hasManifest": true,
  "sinceVersion": "2.1.0",
  "note": "Privacy manifest added in 2.1.0",
  "source": "https://pub.dev/packages/my_plugin/changelog"
}

lib/src/services/known_sdk_data_collection.json — add a data collection entry:

{
  "package": "my_plugin",
  "requiresPrivacyManifest": true,
  "citationUrl": "https://example.com/privacy",
  "appStoreCategories": {
    "collects": ["Device ID"],
    "linked": ["Device ID"],
    "tracking": ["Device ID"]
  },
  "googlePlayCategories": {
    "collected": ["Device or other IDs"],
    "shared": ["Device or other IDs"]
  },
  "notes": "Collects device ID for attribution."
}

Open a pull request with a source URL pointing to the SDK's own privacy documentation.


Disclaimer

This tool generates a DRAFT starting point to speed up your privacy review. It is NOT a legal compliance determination or a guarantee of App Store / Play Store approval.

Before submitting:

  • Verify answers against your app's actual runtime behavior
  • Check each SDK's current published privacy documentation
  • Consult a qualified legal or privacy professional if needed

The authors of flutter_privacy_doctor accept no liability for submissions made solely on the basis of this tool's output.


Resources


License

MIT — see LICENSE.

Libraries

flutter_privacy_doctor
Flutter Privacy Doctor — audit Flutter dependencies for iOS privacy manifest compliance and generate App Store Privacy Labels and Google Play Data Safety forms.