Expo in-app purchase tutorial
A practical path for adding cross-platform in-app purchases and subscriptions to a React Native app built with Expo's managed workflow, from project creation through native builds and device testing.
Why the managed workflow fits this task
Expo simplifies developing, testing, and releasing React Native apps by handling much of the Android and iOS native build work, so developers can focus on JavaScript and TypeScript. Two workflows are available: the bare workflow offers more control with a more complex setup, while the managed workflow handles most native complexity. This guide uses the managed workflow, now able to include cross-platform purchases and subscriptions through the React Native purchases library without managing native code directly.
Create the project and install dependencies
Create the app with the Expo CLI, then add two dependencies. expo-dev-client adds debug capabilities and lets you load the project from the Expo CLI into builds created by the managed workflow. react-native-purchases is the React Native library for purchases; it needs no special Expo integration but must be installed as a dependency. The exact installation sequence is preserved in protected module code0001.
Configure products, then fetch offerings
Before writing purchase code, configure products and offerings in the purchases dashboard, using the getting-started documentation as a refresher if needed. Then update the app to fetch offerings. When adapting the example code, replace the Apple and Google API key placeholders with owner-supplied keys.
Build native apps in the cloud
Unlike a conventional SDK setup, you do not need to run a development build from Xcode or Android Studio or test in a simulator or emulator. Instead, use the command line to start Android and iOS development builds on Expo's server with the eas tool, wait for them to finish, and install the resulting apps on test devices. EAS stands for Expo Application Services, the cloud services Expo hosts for building native binaries. Run eas build --profile development --platform android for Android and eas build --profile development --platform ios for iOS. For Android, you will be prompted for the application ID registered in Google Play and the purchases dashboard, and for the Android Keystore used to sign the APK; Expo can generate a keystore or you can specify your own. For iOS, you will be prompted for the bundle identifier and code-signing details, including whether to use an existing certificate and provisioning profile or enter Apple ID credentials so EAS creates a provisioning profile and registers your devices.
Make products visible to each store
Android products will not appear until the APK is uploaded to Google Play. Uploading to an internal track is sufficient; the tested APK version number must match the version set up in Google Play. Use sandbox testing for Google Play during development. For iOS, follow the installation instructions provided when the build finishes.
Test on a real device and debug with logs
Start a local development server with expo start --dev-client, then open the Android or iOS app and connect it to that server. The phone may discover the server automatically; if not, enter the computer's local IP address manually. Once connected, the React Native app loads and, if setup is correct, offerings and products appear. If something fails, inspect debug logs printed to the console: Console.app on Mac for iOS, or LogCat or Android Studio for Android. Those logs show which products loaded, which did not, and any associated errors.
| Stage | What you do | Done when |
|---|---|---|
| Create project | Install Expo CLI tools, create the app, add expo-dev-client and react-native-purchases | Dependencies installed |
| Configure commerce | Set up products and offerings; add owner API keys to example placeholders | Offerings ready to fetch |
| Build native apps | Run EAS development builds for Android and iOS; answer identifier and signing prompts | Installable builds returned |
| Publish test builds to stores | Upload Android APK to Google Play internal track with matching version; install iOS build per instructions | Products visible in test apps |
| Test and debug | Run dev-client server, connect device, check offerings; inspect platform logs on failure | Offerings load or errors identified |
Checklist summarizing the workflow; exact commands remain in protected module code0001 and in sections s4/s6.
Frequently asked questions
Which Expo workflow does this guide use?
The managed workflow delegates native build complexity to Expo, while the bare workflow gives more control but requires a more complex technical setup. This guide follows the managed workflow.
What dependencies are needed?
Install expo-dev-client for extra debug capabilities and loading projects from the Expo CLI into managed-workflow builds, and install react-native-purchases as the React Native library. The library does not need special Expo integration, but must be installed as a dependency.
How are native builds produced without Xcode or Android Studio?
Use the eas tool to start Android and iOS development builds on Expo's server, wait for completion, then install the resulting apps on test devices. EAS stands for Expo Application Services, the cloud services Expo hosts for building native binaries. The exact commands are eas build --profile development --platform android and eas build --profile development --platform ios.
What platform-specific setup is required before products appear?
For Android, upload the APK to Google Play, with an internal track sufficient, and ensure the tested version number matches the version set up in Google Play. For iOS, provide the bundle identifier and code-signing information, or let EAS create a provisioning profile and register devices when Apple ID credentials are entered.
How do you test the app on a device?
Run expo start --dev-client to start a local development server, then connect the native app to it, manually entering the computer's local IP address if automatic discovery does not find it.
Where do you look when offerings do not load?
Check debug logs printed to the console: use Console.app on Mac for iOS, or LogCat or Android Studio for Android. The logs show which products can or cannot be loaded and associated errors.