The complete guide to getting started with react-native-auth0 is our React Native QuickStart.
Clone the repository and install the dependencies with Yarn:
git clone git@github.com:auth0-samples/auth0-react-native-sample.git
cd auth0-react-native-sample
yarn install
Change the directory into the ios
folder and run the following command to install the SDK pod with CocoaPods:
cd ios
pod install
You should see the A0Auth0
pod being installed and linked to the sample app.
Open the android/app/src/main/AndroidManifest.xml
file and locate the Intent Filter declaration. You must update the android:host
property to use your Auth0 Domain from the step above.
<data
android:host="{YOUR_DOMAIN}"
android:pathPrefix="/android/${applicationId}/callback"
android:scheme="${applicationId}" />
The applicationId
will get auto-completed dynamically.
app/auth0-configuration.js.example
in this sample to app/auth0-configuration.js
.app/auth0-configuration.js
file created above.YOUR_DOMAIN
with the Domain from above. These URLs are required for the authentication result to be redirected from the browser to the app:com.auth0samples://YOUR_DOMAIN/ios/com.auth0samples/callback,
com.auth0samples://YOUR_DOMAIN/android/com.auth0samples/callback
Run your app on an emulator, simulator, or your own connected device.
yarn run ios
.yarn run android
.The first run may take a while to fully launch. Keep an eye out for confirmation windows and watch the terminal for output and results.
Note: If you get an error about “No bundle URL present” try clicking reload in the app or running yarn run ios
again.
Author: SammyRobensParadise
Source Code: https://github.com/SammyRobensParadise/verify
#react-native #react #mobile-apps