In order to use Expo modules in your app, you will need to install and configure the expo package.
The expo package has a small footprint; it includes only a minimal set of packages that are needed in nearly every app and the module and autolinking infrastructure that other Expo SDK packages are built with. Once the expo package is installed and configured in your project, you can use npx expo install to add any other Expo module from the SDK.
To install and use Expo modules, the easiest way to get up and running is with the install-expo-modules command.
# Install and configure the expo package automaticallynpx install-expo-modules@latest
When the command succeeds, you will be able to add any Expo module in your app! Proceed to Usage for more information.
If the command fails, please follow the manual installation instructions. Updating code programmatically can be tricky, and if your project deviates significantly from a default React Native project, then you need to perform manual installation and adapt the instructions here to your codebase.
The following instructions apply to installing the latest version of Expo modules in React Native 0.68.
npm install expo
Once installation is complete, apply the changes from the following diffs to configure Expo modules in your project. This is expected to take about five minutes, and you may need to adapt it slightly depending on how customized your project is.
Optionally, you can also add additional delegate methods to your AppDelegate.mm. Some libraries may require them, so unless you have a good reason to leave them out, it is recommended to add them. See delegate methods in AppDelegate.mm.
Save all of your changes. In Xcode, update the iOS Deployment Target under Target → Build Settings → Deployment to iOS 12.0. The last step is to install the project's CocoaPods again in order to pull in Expo modules that are detected by use_expo_modules! directive that we added to the Podfile:
# Install podsnpx pod-install # Alternatively, the run command will install them for youexpo run:ios