react-native-rdservice-fingerprintscanner 1.1.7 → 1.1.8

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.
@@ -6,6 +6,7 @@ import android.content.Intent;
6
6
  import android.content.pm.ResolveInfo;
7
7
  import android.os.Bundle;
8
8
  import android.util.Log;
9
+ import android.widget.Toast;
9
10
 
10
11
  import androidx.annotation.NonNull;
11
12
 
@@ -200,7 +201,7 @@ public class RDServiceManager {
200
201
  if (mapRDDriverRCIndex.containsKey(rd_service_package)) {
201
202
  int capture_rc_index = mapRDDriverRCIndex.get(rd_service_package);
202
203
  int capture_rc = getRDServiceCaptureRC(capture_rc_index);
203
-
204
+ Toast.makeText(activity, "RDSERVICE BEFORE CAPTURE", Toast.LENGTH_SHORT).show();
204
205
  Log.d(TAG, "RDSERVICE BEFORE CAPTURE: pid_options: (" + capture_rc_index + ") " + capture_rc + " ~ " + pid_options);
205
206
 
206
207
  // Capture fingerprint using RD Service
@@ -210,6 +211,7 @@ public class RDServiceManager {
210
211
  activity.startActivityForResult(intentCapture, capture_rc);
211
212
  } else {
212
213
  mRDEvent.onRDServiceDriverDiscoveryFailed(0, null, rd_service_package, "Package not found or not whitelisted");
214
+ Toast.makeText(activity, "RDSERVICE CAPTURE ERROR", Toast.LENGTH_SHORT).show();
213
215
  Log.d(TAG, "RDSERVICE CAPTURE ERROR: package not found or not whitelisted: " + rd_service_package);
214
216
  }
215
217
  }
@@ -96,13 +96,15 @@ public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModul
96
96
  JSONObject obj = new JSONObject(jsonString);
97
97
  JSONObject response = obj.getJSONObject("PidData").getJSONObject("Resp");
98
98
  String errorCode = response.getString("errCode");
99
- String errInfo = response.getString("errInfo");
99
+ String errInfo = "";
100
+
100
101
  WritableMap responseData = Arguments.createMap();
101
102
  if(Integer.parseInt(errorCode) == 0 ){
102
103
  responseData.putInt("status",1);
103
104
  responseData.putString("message","FingerPrint Scanned Successfully");
104
105
  }
105
106
  else {
107
+ errInfo = response.getString("errInfo");
106
108
  responseData.putInt("status",0);
107
109
  responseData.putString("message","Make Sure the Device is Connected and OTG Connection is Enabled in your Mobile");
108
110
  }
@@ -115,7 +117,8 @@ public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModul
115
117
  promise.resolve(responseData);
116
118
  }
117
119
  catch (JSONException e){
118
- promise.reject("FINGERPRINT_CAPTURE__FAILED","FingerPrint Capture Failed");
120
+ Toast.makeText(getCurrentActivity(), "FINGERPRINT_CAPTURE__FAILED"+e.getMessage(), Toast.LENGTH_SHORT).show();
121
+ promise.reject("FINGERPRINT_CAPTURE__FAILED",e.getMessage());
119
122
  }
120
123
 
121
124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rdservice-fingerprintscanner",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "FingerPrint Scanner RD Service",
5
5
  "main": "src/index.js",
6
6
  "module": "lib/module/index",
package/src/index.d.ts CHANGED
@@ -22,7 +22,7 @@ declare module "react-native-rdservice-fingerprintscanner" {
22
22
  errorCode: number,
23
23
  message: string,
24
24
  }
25
-
25
+ export const DEFAULT_PID_OPTIONS :string
26
26
  export function getDeviceInfo(): Promise<deviceInfoProps | optionalInfo>;
27
27
  export function captureFinger(pidOptions: string):Promise<fingerprintDataProps>;
28
28
 
package/src/index.js CHANGED
@@ -17,7 +17,9 @@ const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner
17
17
  }
18
18
  );
19
19
 
20
- export function getDeviceInfo(){
20
+ export const DEFAULT_PID_OPTIONS = `<PidOptions ver="1.0"> <Opts fCount="1" fType="0" iCount="0" pCount="0" format="0" pidVer="2.0" timeout="20000" otp="" posh="UNKNOWN" env="P" wadh="" /> <Demo></Demo><CustOpts> <Param name="ValidationKey" value="" /> </CustOpts> </PidOptions>`;
21
+
22
+ export function getDeviceInfo() {
21
23
  return new Promise((resolve, reject) => {
22
24
  RdserviceFingerprintscanner.getDeviceInfo()
23
25
  .then((res) => {