Example Expo React Native App using WordPress OAuth2 Server for login.
These instructions will show you how to set up your WordPress website that will act as the Authentication system for your Expo App.
- NodeJS
- If you have HomeBrew:
brew install node
- If you have HomeBrew:
- Expo CLI
npm install expo-cli --global
- Expo App - Used to view your app.
- Install WordPress OAuth Server plugin: https://wordpress.org/plugins/oauth2-provider/
- In WP OAuth Servers settings enable OAuth Server.
- Under Clients create a new client.
- Copy your Client ID
- In
screens/SignInScreen.js
add your client id where it saysCLIENT_ID = 'INSERT-CLIENT-ID';
- Change example.com to your WordPress websites url on the sign in screen as well.
- Install dependencies.
- NPM:
npm install
(If you don't know just use this.) - YARN:
yarn
- NPM:
- Run your app.
- NPM:
npm run start
- YARN:
yarn start
- NPM:
- Expo will create a QR Code.
- With the Expo app installed scan QR code.
- Using a QR Scanner the Expo app can't scan QR codes!
- You can also log into the Expo app and find your app if they're on the same wifi.
- Log into your app using WordPress!