Welcome to BitPay App v2!
Install dependencies with yarn
>= 14.15.0
- Install Pods
cd ios && pod install && cd ..
yarn start
to start dev server- Build and deploy to simulator
yarn ios
or deviceyarn ios:device
yarn start
to start dev server- Build and deploy to simulator or device
yarn android
To make requests to your local server, first take your local BitPay server cert and copy it into android/app/src/main/res/raw
folder in either .pem or .der format.
- To convert .crt to .der, run:
openssl x509 -in your_cert_name.crt -out your_cert_name.der -outform DER
Then open android/app/src/main/res/xml/network_security_config.xml
and add your local IP to the domain-config and your cert to the trust-anchors (without the file extension).
For example if your local IP is 123.0.0.7
and your cert is in res/raw/lbitpay.der
:
<domain-config>
...
<domain includeSubdomains="true">123.0.0.7</domain>
<trust-anchors>
<certificates src="@raw/lbitpay" />
</trust-anchors>
</domain-config>
This project uses react-redux
https://react-redux.js.org/ for state management. To take advantage of the tooling available, go to https://github.com/jhen0409/react-native-debugger and install the debugger.
- To enable - make sure debugger is open - tap
D
in the hosting terminal window or shake the device - A menu will popup - tap
Debug with Chrome
(IOS) orDebug
(Android) - The logs should move from the terminal to the debugger
- In
src/contants/config.ts
changeAPP_LOAD_STORY_BOOK=false
toAPP_LOAD_STORY_BOOK=true
- Run
yarn <platform>
ex:yarn ios
. Since we setAPP_LOAD_STORY_BOOK=true
, this runs Storybook instead of your actual app.
Test deeplinking via command line with these commands (note: ampersand must be escaped for multiple params):
npx uri-scheme open "bitpay://your/deeplink/path?params1=foo1\¶m2=foo2" --ios
npx uri-scheme open "bitpay://your/deeplink/path?param1=foo1\¶m2=foo2" --android
If you want to associate the app with a different intent prefix eg. myapp://
:
- Open
src/constants/config.ts
- Modify
APP_DEEPLINK_PREFIX
to your desired prefix eg.myapp://
(with colon and slashes) - Update the OS specific configs:
1. Open `ios/BitPayApp/info.plist`
2. Find `CFBundleURLSchemes` and modify the value to your desired prefix (without colon and slashes) eg. `myapp`
1. Open `android/app/src/main/AndroidManifest.xml`
2. Locate `<intent-filter><data android:scheme="...">` and modify the value to your desired prefix (without colon and slashes) eg. `myapp`