Skip to content

Latest commit

 

History

History
97 lines (65 loc) · 1.62 KB

README.md

File metadata and controls

97 lines (65 loc) · 1.62 KB

Building and Testing the DemoApp

Prerequisites

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.

To install and publish the SDK using yalc, follow these steps:

  1. Navigate to the root of the RNTrueLayerPaymentsSDK project:
cd RNTrueLayerPaymentsSDK
yarn install
yarn build
  1. Publish the project using yalc:
npx yalc publish
  1. 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.

To install the SDK in the DemoApp, follow these steps:

  1. Navigate to the root of the DemoApp project:
cd DemoApp
  1. Add the SDK using yalc:
npx yalc add rn-truelayer-payments-sdk

Running the DemoApp

  1. Navigate to the root of the DemoApp project:
cd DemoApp
  1. Install the dependencies:
yarn install
  1. Start the development server:
yarn start
  1. For iOS, navigate to the ios directory from the root of the DemoApp project:
cd ios
  1. 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
  1. Navigate back to the root of the DemoApp project and run the DemoApp on iOS:
yarn ios