forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android intent to share VC data with ODK #279
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3e2c6f2
Add intent link for launching via 3rd party ODK Collect
rjmangubat23 1fdd924
chore: cleanup unused code
pmigueld 977842e
feat: add intent for sharing VC data with ODK
pmigueld 584aaa8
feat: integrate ODK intent with app
pmigueld e8dc325
refactor: move intent check to app init
pmigueld 8d3da4e
Merge pull request #199 from idpass/feature/183-odk-vc-request
pmigueld 1a63bcb
Merge pull request #256 from idpass/develop
pmigueld ee7e096
[DSD-3960] inji 0.10.0 release changes
ckm007 d50a12c
[INJI-720] add a workflow to upload to actions without using secrets …
adityankannan-tw 4bbe377
[INJI-700] add workflow for ui automation (#1181)
adityankannan-tw 56294da
Merge branch 'mosip:main' into main
pmigueld ecba00d
Merge remote-tracking branch 'origin/main' into experimental/android-…
pmigueld 8b65cf4
feat: migrate ODK integration to new request machine
pmigueld 74c1ec0
fix: typo
pmigueld 56a414e
fix: typos
pmigueld 2948985
Merge remote-tracking branch 'origin/develop' into experimental/andro…
pmigueld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
|
||
- name: Install npm dependencies | ||
run: | | ||
npm ci | ||
|
@@ -76,12 +76,12 @@ jobs: | |
RELEASE_KEYSTORE_ALIAS: 'androidreleasekey' | ||
RELEASE_KEYSTORE_PASSWORD: "${{ secrets.INJI_ANDROID_RELEASE_STOREPASS }}" | ||
|
||
- name: Configure AWS CLI | ||
- name: Configure AWS CLI | ||
run: | | ||
aws configure set aws_access_key_id ${{ secrets.AWS_DEVICE_FARM_ACCESS_KEY }} | ||
aws configure set aws_secret_access_key ${{ secrets.AWS_DEVICE_FARM_SECRET_KEY }} | ||
aws configure set region us-west-2 | ||
|
||
- name: Android - Automation | ||
id: android-run | ||
run: | | ||
|
@@ -92,17 +92,17 @@ jobs: | |
TEST_TYPE: ${{ github.event.inputs.testType }} | ||
|
||
- name: Download Android Artifacts | ||
run: | | ||
run: | | ||
cd injitest/scripts/ui_automation | ||
./download_artifacts.sh "$RUN_ARN" "Android" | ||
|
||
- name: Upload Artifact to Actions | ||
uses: actions/[email protected] | ||
with: | ||
name: Android-Artifacts | ||
path: injitest/scripts/ui_automation/artifacts/android_artifacts/ | ||
retention-days: 10 | ||
|
||
# - name: Update slack channel | ||
# if: always() | ||
# uses: 8398a7/action-slack@v3 | ||
|
@@ -130,7 +130,7 @@ jobs: | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
|
||
- name: Install npm dependencies | ||
run: | | ||
npm ci | ||
|
@@ -139,7 +139,7 @@ jobs: | |
run: | | ||
cd ios | ||
pod install && pod install | ||
fastlane ios_ui_automation_build | ||
fastlane ios_ui_automation_build | ||
env: | ||
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} | ||
ESIGNET_HOST: ${{ github.event.inputs.backendServiceUrl }} | ||
|
@@ -154,7 +154,7 @@ jobs: | |
APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' | ||
MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' | ||
|
||
- name: Configure AWS CLI | ||
- name: Configure AWS CLI | ||
run: | | ||
aws configure set aws_access_key_id ${{ secrets.AWS_DEVICE_FARM_ACCESS_KEY }} | ||
aws configure set aws_secret_access_key ${{ secrets.AWS_DEVICE_FARM_SECRET_KEY }} | ||
|
@@ -169,7 +169,7 @@ jobs: | |
TEST_TYPE: ${{ github.event.inputs.testType }} | ||
|
||
- name: Download IOS Artifacts | ||
run: | | ||
run: | | ||
cd injitest/scripts/ui_automation | ||
./download_artifacts.sh "$RUN_ARN" "IOS" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,61 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.mosip.residentapp" xmlns:tools="http://schemas.android.com/tools"> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28"/> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/> | ||
<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"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/> | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/> | ||
<uses-permission android:name="android.permission.CAMERA"/> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<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.READ_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.USE_BIOMETRIC"/> | ||
<uses-permission android:name="android.permission.USE_FINGERPRINT"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.mosip.residentapp" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" | ||
android:maxSdkVersion="28" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" /> | ||
<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" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" | ||
android:usesPermissionFlags="neverForLocation" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<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.READ_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.USE_BIOMETRIC" /> | ||
<uses-permission android:name="android.permission.USE_FINGERPRINT" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<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 tools:replace="usesCleartextTraffic" 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" android:usesCleartextTraffic="false"> | ||
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/> | ||
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="48.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/@anonymous/inji"/> | ||
<activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|locale|layoutDirection" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait"> | ||
<application tools:replace="usesCleartextTraffic" 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" android:usesCleartextTraffic="false"> | ||
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true" /> | ||
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="48.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/@anonymous/inji" /> | ||
<activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|locale|layoutDirection" | ||
android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" | ||
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> | ||
<intent-filter> | ||
<action android:name="io.mosip.residentapp.odk.REQUEST" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/> | ||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
android/app/src/main/java/io/mosip/residentapp/ODKIntentModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package io.mosip.residentapp; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
|
||
import com.facebook.react.bridge.Arguments; | ||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.ReadableMap; | ||
|
||
public class ODKIntentModule extends ReactContextBaseJavaModule { | ||
|
||
@Override | ||
public String getName() { | ||
return "ODKIntentModule"; | ||
} | ||
|
||
ODKIntentModule(ReactApplicationContext context) { | ||
super(context); | ||
} | ||
|
||
@ReactMethod | ||
public void isRequestIntent(Promise promise) { | ||
Activity activity = getCurrentActivity(); | ||
Intent intent = activity.getIntent(); | ||
|
||
String action = intent.getAction(); | ||
if (action == "io.mosip.residentapp.odk.REQUEST") { | ||
promise.resolve(true); | ||
} else { | ||
promise.resolve(false); | ||
} | ||
} | ||
|
||
@ReactMethod | ||
public void sendBundleResult(ReadableMap vcData) { | ||
Activity activity = getCurrentActivity(); | ||
|
||
Intent result = new Intent(); | ||
Bundle vcBundle = new Bundle(Arguments.toBundle(vcData)); | ||
for (String key : vcBundle.keySet()) { | ||
result.putExtra(key, vcBundle.getString(key)); | ||
} | ||
|
||
activity.setResult(Activity.RESULT_OK, result); | ||
activity.finish(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
android/app/src/main/java/io/mosip/residentapp/ODKIntentPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.mosip.residentapp; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class ODKIntentPackage implements ReactPackage { | ||
|
||
@Override | ||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
List<NativeModule> modules = new ArrayList<>(); | ||
|
||
modules.add(new ODKIntentModule(reactContext)); | ||
|
||
return modules; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { NativeModules } from 'react-native'; | ||
const { ODKIntentModule } = NativeModules; | ||
|
||
export enum ODKIntentVcField { | ||
UIN = 'uin', | ||
FullName = 'full_name', | ||
DateOfBirth = 'date_of_birth', | ||
Email = 'email', | ||
Phone = 'phone', | ||
Biometrics = 'biometrics', | ||
Issuer = 'issuer', | ||
IssuanceDate = 'issuance_date', | ||
} | ||
|
||
export type ODKIntentVcData = Record<ODKIntentVcField, string>; | ||
|
||
interface ODKIntentInterface { | ||
isRequestIntent: () => Promise<boolean>; | ||
sendBundleResult: (vcData: ODKIntentVcData) => void; | ||
} | ||
|
||
export default ODKIntentModule as ODKIntentInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's return type should be Promise ?