Skip to content
Snippets Groups Projects
README.md 4.87 KiB
Newer Older
DhruvvPandya's avatar
DhruvvPandya committed
# PCM App

## Code

This project utilizes [Aries Framework Javascript (AFJ)](https://github.com/hyperledger/aries-framework-javascript) and [indy-sdk-react-native](https://github.com/hyperledger/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

Steffen Schulze's avatar
Steffen Schulze committed
Pre Settings: 
- Follow this [instructions](https://rlogicaltech.medium.com/how-to-install-react-native-on-mac-step-by-step-guide-1ac822aedd4f) 
- Fix Flipper File if required (https://github.com/facebook/react-native/issues/43335#issuecomment-1980285308)
Steffen Schulze's avatar
Steffen Schulze committed

DhruvvPandya's avatar
DhruvvPandya committed
1. React Native Setup:
   - React Native installation instructions are documented [here](https://reactnative.dev/docs/environment-setup).
   - (iOS) Install [Cocoa Pods](https://cocoapods.org/)
Steffen Schulze's avatar
Steffen Schulze committed
   Note: CocoaPod Installation may require to ship arround the pre installed ruby installation. Follow please this instructions to upgrade to the latest over brew (https://mac.install.guide/ruby/13), after that drb can be upgraded by gem update drb, and after that cocoa pods can be installed via gem install cocoapods
DhruvvPandya's avatar
DhruvvPandya committed
2. Clone the PCM repo and install its dependencies:
DhruvvPandya's avatar
DhruvvPandya committed
   ```sh
Alexey Lunin's avatar
Alexey Lunin committed
   git clone https://gitlab.eclipse.org/eclipse/xfsc/pcm/app.git
dhanashree.tambe's avatar
dhanashree.tambe committed
   yarn install
DhruvvPandya's avatar
DhruvvPandya committed
   ```
3. (iOS) iOS specific install:
   - Install iOS Pods:
     ```sh
     cd ios
     pod install
     ```
   - In the /ios directory, open the project workspace file in Xcode.
DhruvvPandya's avatar
DhruvvPandya committed
     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 
DhruvvPandya's avatar
DhruvvPandya committed
   - Adjust the bundle identifier if needed.

## Configure

In the root directory add an `.env.development` file containing:
dhanashree.tambe's avatar
dhanashree.tambe committed
MEDIATOR_URL=https://www.example.com/mediator

DhruvvPandya's avatar
DhruvvPandya committed

## Run

- Launch the metro bundler:
  ```sh
DhruvvPandya's avatar
DhruvvPandya committed
  yarn start
DhruvvPandya's avatar
DhruvvPandya committed
  ```
- Open a second terminal and run:
  - (Android)
    ```sh
DhruvvPandya's avatar
DhruvvPandya committed
    yarn android:dev
DhruvvPandya's avatar
DhruvvPandya committed
    ```
  - (iOS)
    ```sh
DhruvvPandya's avatar
DhruvvPandya committed
    yarn ios:dev
DhruvvPandya's avatar
DhruvvPandya committed
    ```
  - (iOS) Via Xcode:
    Choose your physical iOS device as the destination. Click the "Play" button to Build and Run.

**NOTE: PCM does not work on iOS simulators** -- use a physical device instead.

### Advanced Configuration

#### Mediator

DhruvvPandya's avatar
DhruvvPandya committed
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](https://github.com/hyperledger/aries-rfcs/tree/main/features/0211-route-coordination).
DhruvvPandya's avatar
DhruvvPandya committed

## 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

```sh
rm -rf node_modules
dhanashree.tambe's avatar
dhanashree.tambe committed
yarn install
DhruvvPandya's avatar
DhruvvPandya committed
```

Clean the Android build:

```sh
cd android
./gradlew clean
cd ..
```

Start and clean the Metro cache:

```sh
dhanashree.tambe's avatar
dhanashree.tambe committed
yarn start
DhruvvPandya's avatar
DhruvvPandya committed
```

In your second terminal, you can now run:

```sh
dhanashree.tambe's avatar
dhanashree.tambe committed
yarn android
DhruvvPandya's avatar
DhruvvPandya committed
```
Kalin Canov's avatar
Kalin Canov committed

Alexey Lunin's avatar
Alexey Lunin committed
## Building local android apk file in debug mode

Create .env file with environment variables

Run command in root folder of app project

```sh
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

```sh
./gradlew assembleDebug
```

As a result you will get apk file in `./android/app/build/outputs/apk/[production|development]`


Alexey Lunin's avatar
Alexey Lunin committed
## How to prepare next application android release

Put correct password for android upload key in the file `android/gradle.properties` for `MYAPP_UPLOAD_STORE_PASSWORD` and `MYAPP_UPLOAD_KEY_PASSWORD`

Run command in root folder of app project

```sh
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

```sh
./gradlew bundleRelease
```

After that you will find `app-release.aab` file in `./android/app/build/outputs/bundle/release` folder

Alexey Lunin's avatar
Alexey Lunin committed
## Useful commends

`./gradlew signingReport` - In order to find out what's wrong with apk signing you can use gradle's signingReport command.
Alexey Lunin's avatar
Alexey Lunin committed
## Latest Android version
Kalin Canov's avatar
Kalin Canov committed
<hr/>

[Android PCM](https://vereign0-my.sharepoint.com/:f:/g/personal/kalin_canov_vereign_com/EiwSfVWCOllDiSC57_DE_xABBVKkiJYx_tANEvbJiI9lGQ?e=3VBnIX)

Kalin Canov's avatar
Kalin Canov committed
## GDPR
<hr/>

[GDPR](GDPR.md)
DhruvvPandya's avatar
DhruvvPandya committed

Kalin Canov's avatar
Kalin Canov committed
### Note
Kalin Canov's avatar
Kalin Canov committed
`Man in the mid` security concern it will be addressed in Phase II. One of the discussed options is to use [TRAIN API](https://train.trust-scheme.de/info/) 
Kalin Canov's avatar
Kalin Canov committed

Kalin Canov's avatar
Kalin Canov committed
## Dependencies
<hr/>

[Dependencies](package.json)

Kalin Canov's avatar
Kalin Canov committed
## License
<hr/>

[Apache 2.0 license](LICENSE)