This is a demo of the React Native Juicebox SDK.
The serverless demo intends to demonstrate a Juicebox onboarding flow that generates Juicebox authentication tokens within the application, without requiring a backend server.
To perform authentication and achieve these goals, registering typically looks something like:
- Generate a random Secret ID with the SDK
- Request the user's PIN
- Use the Secret ID along with your signing key to request Juicebox tokens for the configured realms from the SDK
- Perform the appropriate Juicebox operation using the SDK (register or recover)
- Store the Secret ID so it can be available during recovery across installs and devices. This demo utilizes CloudKit records on iOS and BlockStore on Android for this purpose
First, you will need to start Metro, the JavaScript bundler that ships with React Native.
To start Metro, run the following command from this folder:
# using npm
npm start
# OR using Yarn
yarn start
Let Metro Bundler run in its own terminal. Open a new terminal from this folder.
Run the following command to start the Android or iOS demo:
# using npm
npm run android
# OR using Yarn
yarn android
# using npm
npm run ios
# OR using Yarn
yarn ios
If everything is set up correctly, you should see the demo running in your Android Emulator or iOS Simulator shortly provided you have set up your emulator/simulator correctly.
You can also run it directly from within Android Studio and Xcode respectively by opening the respective projects.