You upload a React Native build to App Store Connect, and a few minutes later Apple sends an email with this subject:
ITMS-91053: Missing API declaration
If you've seen it, this post explains what it means, why React Native apps hit it so often, and how to fix it for good. If you haven't seen it yet, this is how to make sure you never do.
What Apple wants
Since May 2024, every iOS app has to explain why it uses certain APIs that could be used to identify a device. Apple calls them required reason APIs. There are five groups:
- User defaults (simple key-value storage)
- File timestamps (when a file was created or changed)
- System boot time
- Disk space
- Active keyboards
Your app has to list each group it uses in a file called PrivacyInfo.xcprivacy, together with an approved reason code. If one is missing, Apple flags the upload.
Why React Native apps get caught
Your JavaScript never touches these APIs. Your libraries do. Storage, device info, file system, maps, video, Firebase, analytics: each one may use some of them in its native iOS code.
Some libraries ship their own privacy file. But React Native links most native code statically through CocoaPods, and as Expo's privacy guide points out, Apple doesn't reliably read those library files. The safe fix is to declare everything your libraries use in your app's own privacy file.
Doing that by hand means opening every native library in node_modules, searching its iOS code, picking the right reason codes, and repeating it every time you add or update a library.
Nobody does that. So I built a tool for it.
The fix: one command
rn-privacy is a free, open-source CLI. Run it in your app folder:
npx rn-privacy
In about a second it scans every native library in your app and lists:
- which of the five API groups your app needs to declare
- which libraries use each one
- which libraries use them without declaring them anywhere (these are the ones that trigger ITMS-91053)
Then check your app and fix it:
npx rn-privacy check
npx rn-privacy ios --write
check tells you exactly what's missing. On one of my apps it said:
✗ Missing required reason API: Disk space (used by react-native-maps, GoogleMaps SDK)
ios --write then adds the missing entries for you:
-
Bare React Native: it updates
ios/<YourApp>/PrivacyInfo.xcprivacy -
Expo: it updates
app.json
It only adds. Nothing already in your file is removed, and without --write it just shows what it would change.
Never get the email again
Add one line to your CI:
- run: npx rn-privacy check
Now when someone adds a library that needs a new declaration, your build fails, not your App Store upload.
Bonus: the store privacy forms
Both stores also ask what data your app collects: App Privacy in App Store Connect and Data safety in Google Play Console. Again, most of that data is collected by your libraries.
rn-privacy knows what popular SDKs collect (Firebase, Sentry, AdMob, Meta, Mixpanel, Amplitude, PostHog, Segment, RevenueCat, OneSignal, AppsFlyer, Branch and more) and drafts the answers for both stores:
npx rn-privacy report -o store-privacy.md
It also tells apart data your app can read (camera, location, contacts) from data it collects. Using expo-location doesn't mean you must declare location. You only declare it if you send it to a server.
What I found on real apps
Before publishing, I ran it on two production apps, one Expo and one bare React Native:
- One had no privacy file at all, while its libraries used 4 of the 5 API groups.
- The other was missing Disk space, needed by
react-native-mapsand the Google Maps SDK. - Several popular libraries used these APIs in their iOS code without declaring them.
Neither app had shown any warning. Both would have been flagged by Apple.
Reason codes cheat sheet
When a library doesn't give a reason, rn-privacy suggests the one most apps use. Make sure it matches what your app does:
-
CA92.1: User defaults, data only your app can access -
1C8F.1: User defaults, shared with your widgets or extensions -
C617.1: File timestamps, for files inside your app -
3B52.1: File timestamps, for files the user picked -
35F9.1: Boot time, to measure time between events -
E174.1: Disk space, checking there's room before saving files -
85F4.1: Disk space, showing free space to the user
Codes C56D.1 and 0A2A.1 are only for SDKs and must never go in an app's file. rn-privacy removes them for you.
Honest limits
- It's a starting point, not legal advice. You're responsible for what you declare.
- It can't see what your own code or server does with user data.
- It knows the data practices of the libraries in its list. Others are still scanned for the five API groups.
- It never turns on tracking settings for you. If you use ad SDKs, set that up yourself.
Try it
It's free, takes a second, and changes nothing unless you add --write.
This is my first open-source package. If a library you use is missing, or the tool gets something wrong, please open an issue.
Have you been hit by ITMS-91053? Which library caused it? Tell me in the comments 👇
Top comments (0)