The React Native Example App is using the Onewelcome React Native SDK to perform secure authentication and resource calls.
-
npm install
ORyarn
-
Make sure to folow the SDK Configuration and Resolving dependecies sections.
-
run
yarn android
oryarn ios
Note if you encounter an error
No simulator available with name "iPhone 13"
run the command with a proper simulator, e.g.yarn ios --simulator="iPhone 14"
- Get access to https://repo.onegini.com/artifactory/onegini-sdk
- Use https://github.com/Onegini/onegini-sdk-configurator on your application (instructions can be found there)
Before you can compile the application it must be able to resolve it's dependencies. The Onegini Android SDK is one of those dependencies. We have an Artifactory repository that distributes the required dependencies. Make sure that you have access to the Onegini Artifactory repository (https://repo.onegini.com). If you don't have access, no problem just go to the App developer quickstart and perform the first step. Access to Artifactory is required to let Gradle download the Onegini Android SDK library.
When you have access you have to make sure that your Artifactory username and password are set in the gradle.properties
file in your
Gradle user home
(e.g. ~/.gradle):
Example contents of the gradle.properties
file in you Gradle user home:
artifactory_user=<username>
artifactory_password=<password>
See the documentation below for instructions on setting Gradle properties: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties
The Example app includes the Onegini SDK as a Cocoapod. In order to let Cocoapods download it you need to setup your account details so the SDK can be automatically downloaded:
- Make sure that you have access to the Onegini Artifactory repository (https://repo.onegini.com). If not please follow first step of App developer quickstart.
- Follow Setting up the project guide in the Onegini SDK documentation for instructions on configuring access to the Onegini Cocoapods repository.
Note Don't forget to update the Onegini Cocoapods repository with the following command:
pod repo-art update onegini
. If you don't update the repo it may be that the SDK dependency cannot be found. If that is the case be sure to execute the command above.
- Run
pod install
to correctly setup the Cocoapods dependencies - Make sure that you open the project referring to
RNExampleApp.xcworkspace
in Xcode or AppCode.
The example app is already configured with the token server out of the box for both Android and iOS.
If there is a need to change the token server configuration within the example app it is going to be best to do it using the Onegini SDK Configurator. Follow
the steps as described in: https://github.com/onewelcome/sdk-configurator
You will need to set the configuration seperately for iOS and Android.
The SDK can be developed locally using the example app. React Native does not support symlinking with dependencies in the node_modules folder because of the metro bundler see issue.
In order to develop the sdk you can use an npm package called yalc
This package allows us to set up a local npm repository to publish our SDK to. To get started, install yalc following their instructions.
In the SDK folder run: yalc publish
In the example app folder run yalc add @onewelcome/react-native-sdk
After making changes to the SDK you can run yalc publish --push
. This will automatically update the dependency in the example app aswell.