What the scanner reads in a Flutter project
stringer-preflight scans .dart files and pubspec.yaml for package names, and the native side under ios/: ios/Runner/Info.plist, ios/Runner/PrivacyInfo.xcprivacy, Runner.entitlements and project.pbxproj. Code inside if (kDebugMode) is removed before matching, *_test.dart and integration_test/ are skipped, and Pods/ is never read.
npx skills add komako-workshop/stringers # agent skill: "preflight this app for App Store review"
stringer-preflight . --strict # or run the scanner from the Flutter project rootThe Flutter package to rule map
| Package or call in Dart | Rule | What must exist on the iOS side |
|---|---|---|
camera, mobile_scanner, ImageSource.camera | IOS-PLIST-001 | NSCameraUsageDescription in ios/Runner/Info.plist |
photo_manager, image_gallery_saver | IOS-PLIST-002 | NSPhotoLibraryUsageDescription or NSPhotoLibraryAddUsageDescription |
geolocator | IOS-PLIST-003 | NSLocationWhenInUseUsageDescription |
speech_to_text, flutter_contacts, flutter_blue, local_auth, health | IOS-PLIST-004 | The matching speech, contacts, Bluetooth, Face ID or HealthKit key |
shared_preferences | IOS-PRIV-001 / IOS-PRIV-002 | NSPrivacyAccessedAPICategoryUserDefaults in the Runner privacy manifest |
google_mobile_ads, flutter_branch_sdk, singular_flutter_sdk | IOS-PRIV-003 | NSUserTrackingUsageDescription and an app_tracking_transparency request |
in_app_purchase, purchases_flutter | IOS-IAP-001 | A visible Restore Purchases button that calls the restore API |
flutter_stripe, flutter_paypal | IOS-IAP-003 | In-App Purchase for digital goods, or a physical-goods justification |
google_sign_in, flutter_facebook_auth | IOS-AUTH-001 | sign_in_with_apple and the Sign in with Apple capability |
createUserWithEmailAndPassword, signUp( | IOS-AUTH-002 | An in-app account deletion flow |
1. ios/Runner/Info.plist purpose strings
Flutter plugins do not add purpose strings for you. Add each key by hand, with a sentence that says what the data is for in your app (IOS-PLIST-005 fails empty, placeholder and under-16-character strings):
<key>NSCameraUsageDescription</key>
<string>Scan a barcode to look up a product's nutrition facts.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Save your finished collage to your photo library.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Show gyms near your current location.</string>While you are in the file, set export compliance so builds do not stall in "Missing Compliance" (IOS-PLIST-006):
<key>ITSAppUsesNonExemptEncryption</key>
<false/>2. permission_handler: enable only what you use
permission_handler compiles permission code in or out with preprocessor macros in ios/Podfile. Every permission you enable links the corresponding system framework into the binary, and Apple then expects its purpose string (the ITMS-90683 email). Enable exactly the ones your app requests:
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['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
'PERMISSION_PHOTOS=1',
]
end
end
endThe mirror-image mistake is a purpose string for a permission the app never requests. A reviewer who sees a location prompt string in an app with no location feature will ask why. Keep Info.plist and the Podfile list identical.
3. ios/Runner/PrivacyInfo.xcprivacy
shared_preferences reads and writes UserDefaults, a Required Reason API. If the Runner target has no privacy manifest, the scanner raises IOS-PRIV-001; a manifest without the UserDefaults category raises IOS-PRIV-002. Apple's upload check answers the same situation with ITMS-91053.
Open ios/Runner.xcworkspace in Xcode, choose File > New > File > App Privacy, save it as PrivacyInfo.xcprivacy inside Runner/, and tick the Runner target. Creating the file in an editor without adding it to the target is the common failure: the file exists in git and is missing from the app bundle. Use the XML template in the PrivacyInfo.xcprivacy reference.
Third-party SDKs are a separate obligation. Apple keeps a list of commonly used SDKs (Flutter itself, Firebase, GoogleSignIn, FBSDKCoreKit, OneSignal and others) that must ship their own signed manifest; an outdated pod produces ITMS-91061. The fix is nearly always flutter pub upgrade followed by cd ios && pod update, then checking that the pod in Pods/ contains a PrivacyInfo.xcprivacy.
4. Purchases: the Restore button
Guideline 3.1.1 requires a restore mechanism for restorable purchases. With the official plugin:
import 'package:in_app_purchase/in_app_purchase.dart';
Future<void> restorePurchases() async {
await InAppPurchase.instance.restorePurchases();
// restored purchases arrive on InAppPurchase.instance.purchaseStream
}With RevenueCat (purchases_flutter), call await Purchases.restorePurchases() and read the returned customer info. Either way, put a visible "Restore Purchases" control on the paywall or in settings. A subscription paywall also needs Terms of Use and Privacy Policy links and clear billing terms (IOS-IAP-002, Guideline 3.1.2); see the paywall checklist.
flutter_stripe with no In-App Purchase code raises IOS-IAP-003. Stripe is acceptable for physical goods and services used outside the app; digital features and subscriptions must go through In-App Purchase.
5. Sign in with Apple and account deletion
If the app offers google_sign_in or flutter_facebook_auth, Guideline 4.8 requires an equivalent privacy-focused login, in practice Sign in with Apple (IOS-AUTH-001). Add the capability in Xcode under Signing & Capabilities, then:
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
final credential = await SignInWithApple.getAppleIDCredential(
scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName],
);If the app creates accounts, Guideline 5.1.1(v) requires deleting them in-app (IOS-AUTH-002). With Firebase Auth that is await FirebaseAuth.instance.currentUser?.delete() after re-authentication, plus removal of the user's server-side data. A "contact support to delete" link is rejected. The full flow is in the account deletion guide.
6. Build hygiene
IOS-BUILD-001:http://10.0.2.2:8000(the Android emulator's host alias),localhostor an ngrok URL as the API base. Wrap it inkDebugModeor pass the base URL with--dart-defineper flavor.IOS-BUILD-002: API keys in Dart source or--dart-definevalues are recoverable from the compiled app. Revoke and proxy.IOS-BUILD-005/IOS-PLIST-007: plainhttp://endpoints andNSAllowsArbitraryLoads. Use HTTPS.IOS-BUILD-003: "lorem ipsum" placeholder text andskipLoginorbypassPaywallflags that are not tied tokDebugMode.
7. The Guideline 4.2 trap for wrappers and templates
No scanner can prove this one, and it is the hardest rejection to appeal. A Flutter app that is a webview_flutter shell around a website, or an unmodified template with a new logo, is rejected under Guideline 4.2 (minimum functionality) or 4.3 (spam). Before submitting, make sure the app does something a website cannot: offline data, notifications, camera or sensor input, widgets, a native purchase flow. Then say so in the review notes.
The remaining manual checks apply to every stack:
- Complete a sandbox purchase and a restore on a real device with a fresh sandbox Apple ID.
- Confirm the demo account in App Store Connect still signs in and reaches every gated screen.
- Make sure the app offers enough original, lasting value (4.2) and is not a re-skin of another app (4.3).
- Check that screenshots and previews show this exact build, with no mockup-only features.
- Open the privacy policy and support URLs in a private browser window: they must load without a login.
When the scan is clean, flutter build ipa produces the archive. If an agent runs that command for you, the pre-submit hook blocks it while blockers remain.