Skip to content

Commit

Permalink
Merge pull request #256 from idpass/develop
Browse files Browse the repository at this point in the history
Version 0.4.0
  • Loading branch information
pmigueld authored Nov 9, 2022
2 parents 9dad98f + 3095890 commit 1a63bcb
Show file tree
Hide file tree
Showing 189 changed files with 10,841 additions and 4,587 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MIMOTO_HOST=https://api.qa4.mosip.net/residentmobileapp
#MIMOTO_HOST=http://mock.mimoto.newlogic.dev
GOOGLE_NEARBY_MESSAGES_API_KEY=
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---

name: Bug report
about: Create a report to help us improve
title: ''
labels: bug, triage
assignees: jeremi, kneckinator
---
assignees:

**Describe the bug**
A clear and concise description of what the bug is.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, triage
assignees: jeremi, kneckinator
assignees:

---

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/android-custom-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0

# Cache stuff for faster build
- name: Cache local npm repository
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.npm

- name: Cache local gradle repository
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
path: |
Expand All @@ -48,7 +48,7 @@ jobs:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3.1.1
with:
name: apk-output
path: android/app/build/outputs/apk/newlogic/release/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0

# Cache stuff for faster build
- name: Cache local npm repository
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.npm

- name: Cache local gradle repository
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
path: |
Expand All @@ -45,7 +45,7 @@ jobs:
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3.1.1
with:
name: output
path: android/app/build/outputs/apk/newlogic/release/
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/clear_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Delete old artifacts'
on:
workflow_dispatch:

jobs:
delete-artifacts:
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.ACTION_PAT }}
expire-in: 2days # Setting this to 0 will delete all artifacts
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Install npm dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@ buck-out/
*.jsbundle

# CocoaPods
/ios/Pods/
ios/Pods/

# OS X temporary files that should never be committed
.DS_Store
src/components/.DS_Store

# user personal info,for example debug info
ios/ProjectName.xcodeproj/project.xcworkspace/
ios/ProjectName.xcodeproj/xcuserdata

# Podfile versions
ios/Podfile.lock

# Expo
.expo/
Expand All @@ -78,4 +89,5 @@ dist/

.vscode/
temp/
.eslintcache
.eslintcache
.env.local
68 changes: 63 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Be sure to have the following build tools installed before proceeding:
- [Java 8](https://www.oracle.com/ph/java/technologies/javase/javase8-archive-downloads.html)
- [Expo](https://docs.expo.dev/get-started/installation/)
- [Android SDK](https://developer.android.com/)
- [XCode](https://developer.apple.com/xcode/)

## Generate keystore for APK signing

Expand All @@ -29,18 +30,54 @@ keytool \

## Running the app

### Prepare environment

Create a `.env.local` file using `.env` as your template:

```
MIMOTO_HOST=
GOOGLE_NEARBY_MESSAGES_API_KEY=
```

And `android/local.properties`:

```
GOOGLE_NEARBY_MESSAGES_API_KEY=
```

More info here: [Setup Google Nearby Messages in React](https://github.com/mrousavy/react-native-google-nearby-messages#usage)

### Android

```shell
# Install all dependencies
# install all dependencies
npm install

# run Inji Newlogic directly to connected emulator or device (Default)
npm run android:newlogic

# run Inji Mosip directly to connected emulator or device
npm run android:mosip

# run Inji Philippines directly to connected emulator or device
npm run android:ph
```

# Building from Source
### iOS

```shell
# install all dependencies
npm install
npx pod-install

# run Metro bundler in the background
npm start

# run Inji app directly to a connected device
npm run ios -- --device
```

# Developing Android

## Build via Android Studio

Expand Down Expand Up @@ -78,12 +115,33 @@ npm run build:android:mosip

More info here: [Build your app from the command line](https://developer.android.com/studio/build/building-cmdline)

## Build using github actions
One can clone the repo and run the build via github actions as shown below.
# Developing iOS

## Build for TestFlight

1. Install all dependencies
- `npm install`
- `npx pod-install`
2. Open the `ios/` directory in XCode
3. Set the build target to "Any iOS device (arm64)"
4. Use an Apple Developer account that can provision builds for release/TestFlight

![Screen Shot 2022-09-01 at 10 34 45 AM](https://user-images.githubusercontent.com/1631922/187820476-52111665-d6b9-447c-953d-c6451d66b634.png)

5. Don't forget to bump the version number when creating an archive

6. Open the Product menu and from there click Archive

7. Once done you can follow the dialog wizard to distribute the app to TestFlight

![Screen Shot 2022-09-01 at 1 08 34 PM](https://user-images.githubusercontent.com/1631922/187836055-617fbba8-2eca-4ad3-805b-9627b925f0df.png)

8. Go to your [App Store Connect](https://appstoreconnect.apple.com/) dashboard to manage the newly-uploaded build.

![](docs/images/build_github_actions.png)
More info here:

- [React Native - Publishing to the App Store](https://reactnative.dev/docs/publishing-to-app-store)
- [Apple Developer - Distributing Your App for Beta Testing and Releases](https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases)

## Credits

Expand Down
7 changes: 6 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,13 @@ android {
// https://github.com/gladed/gradle-android-git-version#3-use-a-git-tag-to-specify-your-version-number-see-semantic-versioning
versionName androidGitVersion.name()
versionCode androidGitVersion.code()

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

manifestPlaceholders = [
APP_NAME : APP_NAME_RELEASE
APP_NAME: APP_NAME_RELEASE,
GOOGLE_NEARBY_MESSAGES_API_KEY: "${properties.getProperty('GOOGLE_NEARBY_MESSAGES_API_KEY')}"
]
}
splits {
Expand Down
65 changes: 33 additions & 32 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.mosip.residentapp">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="43.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@nlpaolo/mosip-resident-app"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true" />
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="43.0.0" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@nlpaolo/mosip-resident-app" />
<meta-data android:name="com.google.android.nearby.messages.API_KEY" android:value="${GOOGLE_NEARBY_MESSAGES_API_KEY}" />
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="io.mosip.residentapp"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="io.mosip.residentapp" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
</manifest>
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
}
repositories {
google()
gradlePluginPortal()
mavenCentral()
jcenter()
}
Expand All @@ -35,9 +36,10 @@ allprojects {
}

google()
gradlePluginPortal()
mavenCentral()
jcenter()
maven { url 'https://www.jitpack.io' }
jcenter()
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.54.0
FLIPPER_VERSION=0.99.0

# The hosted JavaScript engine
# Supported values: expo.jsEngine = "hermes" | "jsc"
Expand Down
3 changes: 0 additions & 3 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export default {
backgroundColor: '#FFFFFF',
},
},
extra: {
backendServiceUrl: process.env.BACKEND_SERVICE_URL,
},
platforms: ['android', 'ios'],
privacy: 'hidden',
};
Loading

0 comments on commit 1a63bcb

Please sign in to comment.