Welcome to the Dynamic React Native + Expo Example App! This repository contains a simple application demonstrating how to integrate the Dynamic product with React Native using Expo.
To run this example app locally, you'll need to have Node.js installed, as well as npm (Node Package Manager). Additionally, you must install Expo CLI. For detailed setup instructions, please visit the Expo installation guide.
You will also need a Dynamic account. If you don't have one yet, you can sign up for free at Dynamic. With an account created, you can create a new project and obtain the environment ID, which you will need to initialize the Dynamic client in the example app. You will also need to enable the SMS and/or Email Login options to have a login method available in the example app.
Follow these steps to get the app up and running:
-
Set Up Your Environment
Prepare your development environment for React Native by following the official setup guide: React Native Environment Setup.
-
Clone the repository:
git clone https://github.com/dynamic-labs/react-native-expo.git cd react-native-expo
-
Install dependencies:
npm install
-
(Optional) Configure a
.env
File with Your Dynamic Environment ID:EXPO_PUBLIC_ENVIRONMENT_ID=<dynamic project environment id>
-
Start the application:
iOS
npm run ios
Having trouble running the iOS simulator? Check out the iOS Troubleshooting guide.
Android
npm run android
This will start the Expo CLI server, and you can open the app on your device using the Expo Go app, or in a web browser.
For further development, you may find the following files relevant:
- dynamic client initialization:
src/client.ts
- HomeView:
src/Home/Home.tsx
- LoginView:
src/LoginView/LoginView.tsx
- DisplayAuthenticatedUserView:
src/DisplayAuthenticatedUserView/DisplayAuthenticatedUserView.tsx
For more detailed information on integrating Dynamic with React Native, please refer to our official documentation: Dynamic React Native Integration.
Thank you for trying out our example app!