- An Android / Apple Phone with a SIM card and mobile data connection
- For iOS: Require XCode >12
- For Android:
- Require JDK 14 (Java version 14.02 / Gradle v6.3).
- Android Studio or Android SDK manager via Android developer downloads. VS Code would work as you aren't using a virtual device.
- Set up the React Native Environment
- For metro bundler, require node version > 10
Clone the starter-files
branch via:
git clone -b starter-files --single-branch https://github.com/tru-ID/passwordless-auth-react-native
To restore dependencies, open a new terminal and run:
npm install
Create a tru.ID Account
Install the tru.ID CLI via:
npm i -g @tru_id/cli
Input your tru.ID credentials which can be found within the tru.ID console
Install the tru.ID CLI development server plugin
Create a new tru.ID project within the root directory via:
tru projects:create rn-auth
Run the development server, pointing it to the directly containing the newly created project configuration. This will also open up a localtunnel to your development server making it publicly accessible to the Internet so that your mobile phone can access it when only connected to mobile data.
tru server -t --project-dir ./rn-auth
To start the project, ensure you have a physical device connected (see Running React Native on a physical device guide ) then run:
npm run android
#or
npm run ios
While trying to run on Android, you might run into Could not find or load main class org.gradle.wrapper.GradleWrapperMain
error. To resolve it:
- Install Gradle
- Navigate to the Android directory and run
gradle wrapper
- Run
npm run android
Distributed under the MIT License. See LICENSE