@digiotech/react-native 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Digio React Native SDK
2
2
 
3
+ [![npm version](https://badge.fury.io/js/@digiotech%2Freact-native.svg)](https://badge.fury.io/js/@digiotech%2Freact-native)
4
+
3
5
  Official React Native SDK for Digio Gateway Integration
4
6
 
5
7
  ## Installation
@@ -10,7 +12,7 @@ yarn install @digiotech/react-native
10
12
 
11
13
  ## Documentation
12
14
 
13
- Documentation of Digio Gateway Integration and their usage is available at <https://documentation.digio.in>
15
+ Documentation of Digio Gateway Integration and their usage
14
16
 
15
17
  ### Basic Usage
16
18
 
@@ -112,3 +114,45 @@ function YourComponent() {
112
114
  | documentId | string | Document ID Passed from the parent app. For eg: `KID22040413040490937VNTC6LAP8KWD` |
113
115
  | message | string | Error message in case of crash or failure |
114
116
  | permissions | Array<string> | List of mandatory permissions which are not given during kyc journey |
117
+
118
+ ### Android Permissions
119
+
120
+ Add required permissions in the manifest file. Note - This is the common SDK for various KYC flows
121
+
122
+ ```
123
+ <!--RECORD_AUDIO and MODIFY_AUDIO_SETTINGS Permission required for Video KYC -->
124
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
125
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
126
+ /** Required for geotagging */
127
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
128
+ /** Required for ID card analysis, selfie and face match**/
129
+ <uses-permission android:name="android.permission.CAMERA" />
130
+ <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
131
+ ```
132
+ A fintech Android app can't access the following permission
133
+ - Read_external_storage
134
+ - Read_media_images
135
+ - Read_contacts
136
+ - Access_fine_location
137
+ - Read_phone_numbers
138
+ - Read_media_videos
139
+
140
+ ### IOS Permission
141
+
142
+ Permissions need to add in your info.plist
143
+ ```
144
+ /** Camera permission incase of selfie/video KYC/ capture document **/
145
+ <key>NSCameraUsageDescription</key>
146
+ <string>$(PRODUCT_NAME) would like to access your camera.</string>
147
+ <key>NSPhotoLibraryUsageDescription</key>
148
+ <string>$(PRODUCT_NAME) would like to access your photo.</string>
149
+ /** Microphone permission incase of video KYC **/
150
+ <key>NSMicrophoneUsageDescription</key>
151
+ <string>$(PRODUCT_NAME) would like to access your microphone to capture video.</string>
152
+ /** Location permission for geo tagging for camera/video kyc/ selfie **/
153
+ <key>NSLocationWhenInUseUsageDescription</key>
154
+ <string>$(PRODUCT_NAME) would like to access your location.</string>
155
+ <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
156
+ <string>$(PRODUCT_NAME) would like to access your location.</string>
157
+ ```
158
+ Note : All permissions should be checked and taken before triggering Digio SDK
@@ -88,8 +88,9 @@ dependencies {
88
88
  //noinspection GradleDynamicVersion
89
89
  implementation "com.facebook.react:react-native:+"
90
90
  implementation 'com.github.digio-tech:gateway:v4.0.8'
91
- implementation 'com.github.digio-tech:gateway_kyc:v4.0.8'
92
- implementation 'androidx.appcompat:appcompat:1.6.1'
91
+ implementation fileTree(dir: "libs", include: ["*.aar"])
92
+ // implementation 'com.github.digio-tech:gateway_kyc:v4.0.8'
93
+ implementation 'androidx.appcompat:appcompat:1.1.0'
93
94
  implementation 'com.google.android.material:material:1.9.0'
94
95
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
95
96
  implementation "androidx.camera:camera-core:1.1.0"
@@ -17,6 +17,7 @@ import com.facebook.react.bridge.Arguments;
17
17
  import com.facebook.react.bridge.Promise;
18
18
  import com.facebook.react.bridge.ReactApplicationContext;
19
19
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
+ import com.facebook.react.bridge.LifecycleEventListener;
20
21
  import com.facebook.react.bridge.ReactMethod;
21
22
  import com.facebook.react.bridge.ReadableMap;
22
23
  import com.facebook.react.bridge.WritableArray;
@@ -40,7 +41,7 @@ import in.digio.sdk.gateway.model.DigioConfig;
40
41
  import in.digio.sdk.gateway.model.DigioTheme;
41
42
 
42
43
  @ReactModule(name = DigioReactNativeModule.NAME)
43
- public class DigioReactNativeModule extends ReactContextBaseJavaModule {
44
+ public class DigioReactNativeModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
44
45
  public static final String NAME = "DigioReactNative";
45
46
 
46
47
  public static final String AAR_VERSION = "4.0.8";
@@ -127,11 +128,23 @@ public class DigioReactNativeModule extends ReactContextBaseJavaModule {
127
128
  public DigioReactNativeModule(ReactApplicationContext reactContext) {
128
129
  super(reactContext);
129
130
  reactContext.addActivityEventListener(activityEventListener);
130
- ContextCompat.registerReceiver(
131
- reactContext, eventBroadcastReceiver,
132
- new IntentFilter(DigioConstants.GATEWAY_EVENT),
133
- ContextCompat.RECEIVER_NOT_EXPORTED
134
- );
131
+ this.getReactApplicationContext().addLifecycleEventListener(this);
132
+ }
133
+
134
+ @Override
135
+ public void onHostResume() {
136
+ IntentFilter filter = new IntentFilter(DigioConstants.GATEWAY_EVENT);
137
+ this.getReactApplicationContext().registerReceiver(eventBroadcastReceiver, filter);
138
+ }
139
+
140
+ @Override
141
+ public void onHostPause() {
142
+ this.getReactApplicationContext().unregisterReceiver(eventBroadcastReceiver);
143
+ }
144
+
145
+ @Override
146
+ public void onHostDestroy() {
147
+
135
148
  }
136
149
 
137
150
  @Override
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digiotech/react-native",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "SDK for invoking client side journey for any of Digio request",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",