PCM App
Code
This project utilizes Aries Framework Javascript (AFJ) and indy-sdk-react-native.
Project State
Platform
PCM currently is built on React Native 0.66.4
As of now PCM targets Android API 30.0.2
iOS targets iOS 10.0+.PCM can only be run on physical devices as of right now.
Install
- React Native Setup:
- React Native installation instructions are documented here.
- (iOS) Install Cocoa Pods
- Clone the PCM repo and install its dependencies:
git clone https://gitlab.com/gaia-x/data-infrastructure-federation-services/pcm/app.git yarn install
- (iOS) iOS specific install:
- Install iOS Pods:
cd ios pod install
- In the /ios directory, open the project workspace file in Xcode. Once the project is open, navigate to the project's Signing & Capabilities tab and apply your personal Apple Developer Account or your organization's team to target PCM
- Adjust the bundle identifier if needed.
- Install iOS Pods:
Configure
In the root directory add an .env.development
file containing:
NOTIFICATION_URL=http:www.example.com/notification_manager
MEDIATOR_URL=https://www.example.com/mediator
Run
- Launch the metro bundler:
yarn start
- Open a second terminal and run:
- (Android)
yarn android:dev
- (iOS)
yarn ios:dev
- (iOS) Via Xcode: Choose your physical iOS device as the destination. Click the "Play" button to Build and Run.
- (Android)
NOTE: PCM does not work on iOS simulators -- use a physical device instead.
Advanced Configuration
Mediator
In order to use PCM, you must have a mediator to use with the app. PCM is configured to use 'Implicit' mediation and requires a mediator that supports the coordinate-mediation protocol.
Troubleshooting
Hot Reloading
Hot reloading may not work correctly with instantiated Agent objects. Reloading (r
) or reopening the app may work. Any changes made to native modules require you to re-run the compile step.
Dependency Issues, Native Module Linking Issues, or Usage Issues
If you end up changing dependencies or structures, you may need to perform the following steps:
Android
rm -rf node_modules
yarn install
Clean the Android build:
cd android
./gradlew clean
cd ..
Start and clean the Metro cache:
yarn start
In your second terminal, you can now run:
yarn android
Building local android apk file in debug mode
Create .env file with environment variables
Run command in root folder of app project
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Go to path android
and run the command
./gradlew assembleDebug
As a result you will get apk file in ./android/app/build/outputs/apk/[production|development]
Useful commends
./gradlew signingReport
- In order to find out what's wrong with apk signing you can use gradle's signingReport command.
Latest Android version
GDPR
Note
Man in the mid
security concern it will be addressed in Phase II. One of the discussed options is to use TRAIN API