- A tru.ID Account
- A Firebase Account
- 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/firebase-phone-auth-sim-swap-detection.git
If you're only interested in the finished code in main
then run:
git clone -b main --single-branch https://github.com/tru-ID/firebase-phone-auth-sim-swap-detection.git
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-firebase-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-firebase-auth
This project uses React Native Firebase, So, first install both the app
and auth
dependencies:
npm install --save @react-native-firebase/app @react-native-firebase/auth
Then follow the guides within the offical documentation:
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
- React Native Firebase Getting Started
- tru.ID docs
- Running React Native on a physical device guide
- React Native Environment guide
Distributed under the MIT License. See LICENSE