This is a new React Native project, bootstrapped using @react-native-community/cli.
Note: Make sure you have completed the React Native - Environment Setup instructions till "Creating a new application" step, before proceeding.
Before begining with the app, make sure you have build binaries in the root folder.
npm startThis will fetch dependencies and generate compressed binaries in lib/ folder.
This project uses example/src/secrets.json to store local, non-committed keys and configuration for the example app.
Create a secrets.json file in the example/ directory with the following structure (DO NOT commit this file to the repository):
{
"clientKey": "your_client_key",
"demoServerApiKey": "your_demo_server_api_key",
"merchantAccount": "your_merchant_account",
"publicKey": "your_public_key",
"appleMerchantId": "merchant.com.your_apple_merchant_id"
}- CLIENT_KEY: Your Adyen client Key for the client-side drop-in/components.
- DEMO_SERVER_API_KEY: API key key for the Adyen API.
- MERCHANT_ACCOUNT: Your Merchant Account name.
- PUBLIC_KEY: Your public RSA key (optional).
- APPLE_MERCHANT_ID: Your Apple Pay merchant identifier (optional).
Note
For debugging purposes, this app is set up to directly contact the Adyen API.
Do not reach out to the Adyen API directly from your client and never store the API key in your source code.
Let Metro Bundler run in its own terminal. Run the following command to start your Android or iOS app. First, it will start a Metro, the JavaScript bundler that ships with React Native.
# using Yarn
yarn app android# using Yarn
yarn app pod
yarn app iosIf everything is set up correctly, you should see the app running in your Android Emulator or iOS Simulator shortly provided you have set up your emulator/simulator correctly.
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.