Skip to content

Commit cda05b5

Browse files
ian-wdiBotPeaches
andauthored
updated docs (#11)
* docs: add pdf417 data format * docs: convert constants variable name to uppercase * docs: update iOS and android quirks isntruction Co-authored-by: Connor Tumbleson <iBotPeaches@users.noreply.github.com>
1 parent 08c3ac3 commit cda05b5

File tree

3 files changed

+70
-29
lines changed

3 files changed

+70
-29
lines changed

README.md

Lines changed: 67 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,46 @@ React Native ID Scanner wrapper for idscan sdk
88
npm install react-native-idscan-sdk
99
```
1010

11+
## iOS Quirks
12+
13+
This plugins requires the following usage descriptions added to the application plist:
14+
15+
- `NSCameraUsageDescription` specifies the reason for your app to access the device’s camera.
16+
- `NSPhotoLibraryUsageDescription` specifies the reason for your app to access the user’s photo library.
17+
18+
## Android Quirks
19+
20+
- Add idscan-public maven repository to the project build.gradle file.
21+
22+
```
23+
allprojects {
24+
repositories {
25+
...
26+
maven {
27+
url 'https://www.myget.org/F/idscan-public/maven/'
28+
}
29+
...
30+
}
31+
}
32+
```
33+
34+
- Insert the following into the project `AndroidManifest.xml` to request camera permission.
35+
36+
```
37+
<uses-permission android:name="android.permission.CAMERA" />
38+
```
39+
1140
## Usage
1241

1342
```js
1443
import { TouchableOpacity, Text } from 'react-native'
15-
import { scan, IDScanner_Constants } from 'react-native-idscan-sdk';
44+
import { scan, IDSCANNER_CONSTANTS } from 'react-native-idscan-sdk';
1645

1746
// ...
1847

1948
const onScanID = () => {
2049
scan(
21-
IDScanner_Constants.TYPE_PDF, // TYPE_COMBINED, TYPE_MRZ, TYPE_PDF
50+
IDSCANNER_CONSTANTS.TYPE_PDF, // TYPE_COMBINED, TYPE_MRZ, TYPE_PDF
2251
{
2352
// iOS
2453
iosDetectorPDFLicenseKey: 'iOS IdScanner PDF License Key here',
@@ -44,35 +73,47 @@ const onScanID = () => {
4473

4574
```
4675

47-
## iOS Quirks
48-
49-
This plugins requires the following usage descriptions:
50-
51-
- `NSCameraUsageDescription` specifies the reason for your app to access the device's camera.
52-
- `NSPhotoLibraryUsageDescription` specifies the reason for your app to access the user's photo library.
53-
54-
## Android Quirks
55-
56-
- Add idscan-public maven repository to the project build.gradle file.
76+
### PDF417 Response
5777

5878
```
59-
allprojects {
60-
repositories {
61-
...
62-
maven {
63-
url 'https://www.myget.org/F/idscan-public/maven/'
64-
}
65-
...
66-
}
79+
{
80+
namePrefix: string;
81+
IIN: string;
82+
race: string;
83+
gender: string;
84+
fullName: string;
85+
issuerIdNum: string;
86+
city: string;
87+
weight: string;
88+
height: string;
89+
address1: string;
90+
address2: string;
91+
classificationCode: string;
92+
issueDate: string;
93+
licenseNumber: string;
94+
expirationDate: string;
95+
endorsementsCode: string;
96+
issuedBy: string;
97+
firstName: string;
98+
middleName: string;
99+
lastName: string;
100+
nameSuffix: string;
101+
restrictionsCode: string;
102+
birthDate: string;
103+
countryCode: string;
104+
jurisdictionCode: string;
105+
hairColor: string;
106+
eyeColor: string;
107+
documentType: string;
108+
country: string;
109+
weightKG: string;
110+
weightLBS: string;
111+
restrictionCode: string;
112+
postalCode: string;
113+
specification: string;
67114
}
68115
```
69116

70-
- You must ask for camera permission. Insert this to your project's `AndroidManifest.xml`
71-
72-
```
73-
<uses-permission android:name="android.permission.CAMERA" />
74-
```
75-
76117
## Contributing
77118

78119
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

example/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
22

33
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
4-
import { scan, IDScanner_Constants } from 'react-native-idscan-sdk';
4+
import { scan, IDSCANNER_CONSTANTS } from 'react-native-idscan-sdk';
55

66
export default function App() {
77
const [result, setResult] = React.useState<object | undefined>();
88

99
// methods
1010
const triggerScanner = () => {
1111
scan(
12-
IDScanner_Constants.TYPE_PDF,
12+
IDSCANNER_CONSTANTS.TYPE_PDF,
1313
{
1414
// iOS
1515
iosDetectorPDFLicenseKey: 'iOS IdScanner PDF License Key here',

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const IdscanSdk = NativeModules.IdscanSdk
2121
// SDK Constants
2222
const SDKConstants = IdscanSdk.getConstants();
2323

24-
export const IDScanner_Constants = {
24+
export const IDSCANNER_CONSTANTS = {
2525
/**
2626
* Combined PDF and MRZ Scanner
2727
*/

0 commit comments

Comments
 (0)