react-native-rdservice-fingerprintscanner 1.1.7 → 1.1.9

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
@@ -31,7 +31,7 @@ allprojects {
31
31
  ## Usage
32
32
 
33
33
  ```js
34
- import { getDeviceInfo, captureFinger } from "react-native-rdservice-fingerprintscanner";
34
+ import { getDeviceInfo, captureFinger,DEFAULT_PID_OPTIONS } from "react-native-rdservice-fingerprintscanner";
35
35
 
36
36
  // ...
37
37
 
@@ -43,7 +43,7 @@ getDeviceInfo()
43
43
  console.log(error, 'DEVICE DRIVER NOT FOUND'); //Failed to get device information
44
44
  });
45
45
 
46
- captureFinger(pidOptions)
46
+ captureFinger(pidOptions) //you can pass pidOptions (optional) to "captureFinger(pidOptions)"" method otherwise it takes DEFAULT_PID_OPTIONS
47
47
  .then((response) => {
48
48
  console.log(response, 'FINGER CAPTURE'); // FingerPrint Response
49
49
  })
@@ -55,6 +55,8 @@ getDeviceInfo()
55
55
 
56
56
  ```pidOptions``` is an XML String that you have to pass to ```captureFinger``` method. Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf)
57
57
 
58
+ ```DEFAULT_PID_OPTIONS``` is used when you not passed the pidOptions to the ```captureFinger()``` Method.
59
+
58
60
  ```Note``` : Call ```captureFinger()``` Method after getting response from getDeviceInfo() method. Calling of ```captureFinger()``` method before ```getDeviceInfo()``` method, only returns Error in ```catch``` block. Refer [Example Code](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/example/src/App.js)
59
61
 
60
62
 
@@ -85,6 +87,13 @@ pidDataXML | XML DATA | pidData Captured Fingerprint
85
87
  rdServicePackage | Device Package
86
88
  message | Message about Success or Failure
87
89
 
90
+ ## Tested Devices
91
+
92
+ Device Name | Result
93
+ --- | ---
94
+ STARTEK | :white_check_mark:
95
+ MORPHO | :white_check_mark:
96
+ MANTRA | :white_check_mark:
88
97
 
89
98
  ## Contributing
90
99
 
@@ -96,13 +96,14 @@ 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
  WritableMap responseData = Arguments.createMap();
101
101
  if(Integer.parseInt(errorCode) == 0 ){
102
102
  responseData.putInt("status",1);
103
103
  responseData.putString("message","FingerPrint Scanned Successfully");
104
104
  }
105
105
  else {
106
+ errInfo = response.getString("errInfo");
106
107
  responseData.putInt("status",0);
107
108
  responseData.putString("message","Make Sure the Device is Connected and OTG Connection is Enabled in your Mobile");
108
109
  }
@@ -117,8 +118,6 @@ public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModul
117
118
  catch (JSONException e){
118
119
  promise.reject("FINGERPRINT_CAPTURE__FAILED","FingerPrint Capture Failed");
119
120
  }
120
-
121
-
122
121
  }
123
122
 
124
123
  @Override
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.9",
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
@@ -23,6 +23,7 @@ declare module "react-native-rdservice-fingerprintscanner" {
23
23
  message: string,
24
24
  }
25
25
 
26
+ export const DEFAULT_PID_OPTIONS :string;
26
27
  export function getDeviceInfo(): Promise<deviceInfoProps | optionalInfo>;
27
28
  export function captureFinger(pidOptions: string):Promise<fingerprintDataProps>;
28
29
 
package/src/index.js CHANGED
@@ -16,8 +16,9 @@ const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner
16
16
  },
17
17
  }
18
18
  );
19
+ 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>`;
19
20
 
20
- export function getDeviceInfo(){
21
+ export function getDeviceInfo() {
21
22
  return new Promise((resolve, reject) => {
22
23
  RdserviceFingerprintscanner.getDeviceInfo()
23
24
  .then((res) => {
@@ -45,7 +46,7 @@ export function getDeviceInfo(){
45
46
  });
46
47
  }
47
48
 
48
- export function captureFinger(pidOptions) {
49
+ export function captureFinger(pidOptions = DEFAULT_PID_OPTIONS) {
49
50
  return new Promise((resolve, reject) => {
50
51
  RdserviceFingerprintscanner.captureFinger(pidOptions)
51
52
  .then((res) => {