Skip to content

Commit cb48cc2

Browse files
authored
Merge pull request #6 from sourcetoad/android-multiscan-parser
Android Support
2 parents a57596a + 63ab080 commit cb48cc2

File tree

19 files changed

+285
-239
lines changed

19 files changed

+285
-239
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { scan, IDScanner_Constants } from 'react-native-idscan-sdk';
1818

1919
const onScanID = () => {
2020
scan(
21-
IDScanner_Constants.TYPE_PDF, // TYPE_ALL, TYPE_MRZ, TYPE_PDF
21+
IDScanner_Constants.TYPE_PDF, // TYPE_COMBINED, TYPE_MRZ, TYPE_PDF
2222
{
2323
// iOS
2424
iosDetectorPDFLicenseKey: 'iOS IdScanner PDF License Key here',
@@ -51,6 +51,28 @@ This plugins requires the following usage descriptions:
5151
- `NSCameraUsageDescription` specifies the reason for your app to access the device's camera.
5252
- `NSPhotoLibraryUsageDescription` specifies the reason for your app to access the user's photo library.
5353

54+
## Android Quirks
55+
56+
- Add idscan-public maven repository to the project build.gradle file.
57+
58+
```
59+
allprojects {
60+
repositories {
61+
...
62+
maven {
63+
url 'https://www.myget.org/F/idscan-public/maven/'
64+
}
65+
...
66+
}
67+
}
68+
```
69+
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+
5476
## Contributing
5577

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

android/build.gradle

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.5.3'
10+
classpath 'com.android.tools.build:gradle:3.5.4'
1111
}
1212
}
1313
}
1414

1515
apply plugin: 'com.android.library'
16+
apply plugin: 'kotlin-android'
1617

1718
def safeExtGet(prop, fallback) {
1819
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
1920
}
2021

2122
android {
22-
compileSdkVersion safeExtGet('IdscanSdk_compileSdkVersion', 29)
23+
compileSdkVersion safeExtGet('IdscanSdk_compileSdkVersion', 31)
2324
defaultConfig {
24-
minSdkVersion safeExtGet('IdscanSdk_minSdkVersion', 16)
25-
targetSdkVersion safeExtGet('IdscanSdk_targetSdkVersion', 29)
25+
minSdkVersion safeExtGet('IdscanSdk_minSdkVersion', 19)
26+
targetSdkVersion safeExtGet('IdscanSdk_targetSdkVersion', 31)
2627
versionCode 1
2728
versionName "1.0"
28-
2929
}
3030

3131
buildTypes {
@@ -48,6 +48,7 @@ repositories {
4848
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
4949
url("$rootDir/../node_modules/react-native/android")
5050
}
51+
5152
google()
5253
mavenCentral()
5354
jcenter()
@@ -56,4 +57,12 @@ repositories {
5657
dependencies {
5758
//noinspection GradleDynamicVersion
5859
implementation "com.facebook.react:react-native:+" // From node_modules
60+
implementation "androidx.core:core-ktx:1.7.0"
61+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
62+
63+
// IDScan dependencies
64+
implementation 'net.idscan.components.android:dlparser-standard:1.28.4'
65+
implementation 'net.idscan.components.android:multiscan:1.5.1'
66+
implementation 'net.idscan.components.android:multiscan-mrz:1.5.1'
67+
implementation 'net.idscan.components.android:multiscan-pdf417:1.5.1'
5968
}

android/src/main/java/com/reactnativeidscansdk/IDScanner_cordova.java

Lines changed: 0 additions & 160 deletions
This file was deleted.

android/src/main/java/com/reactnativeidscansdk/IdscanSdkModule.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)