Since yarn link/unlink
doesn't work with React Native, you need to install
yalc. Yalc is a tool that enables
you to test local packages without publishing them to npm.
npx yalc --version
You may be prompted to install yalc. If so, accept the installation and then continue with the steps below.
- Navigate to the root of the RNTrueLayerPaymentsSDK project:
cd RNTrueLayerPaymentsSDK
yarn install
yarn build
- Publish the project using yalc:
npx yalc publish
- Build and watch for changes in the SDK project:
yarn yalc:watch
If you are prompted to install a yalc package, accept the installation and rerun
the yarn yalc:watch
command.
- Navigate to the root of the DemoApp project:
cd DemoApp
- Add the SDK using yalc:
npx yalc add rn-truelayer-payments-sdk
- Navigate to the root of the DemoApp project:
cd DemoApp
- Install the dependencies:
yarn install
- Start the development server:
yarn start
- For iOS, navigate to the ios directory from the root of the DemoApp project:
cd ios
- Install the necessary pods:
-
For the new React architecture
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
-
For the old React architecture:
pod install
- Navigate back to the root of the DemoApp project and run the DemoApp on iOS:
yarn ios