dynamsoft-capture-vision-react-native 3.4.1000 → 3.4.1100
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/android/src/main/java/com/dynamsoft/reactnativelib/LicenseModule.kt +11 -0
- package/android/src/main/java/com/dynamsoft/reactnativelib/license/LicenseModuleImpl.kt +10 -0
- package/dynamsoft-capture-vision-react-native.podspec +1 -1
- package/ios/RNDynamsoftLicense.m +11 -0
- package/package.json +1 -1
- package/src/license/LicenseManager.tsx +16 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.dynamsoft.reactnativelib
|
|
2
2
|
|
|
3
|
+
import com.dynamsoft.license.LicenseManager
|
|
3
4
|
import com.dynamsoft.reactnativelib.license.LicenseModuleImpl
|
|
4
5
|
import com.facebook.react.bridge.Promise
|
|
5
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -15,4 +16,14 @@ class LicenseModule(reactApplicationContext: ReactApplicationContext) : ReactCon
|
|
|
15
16
|
fun initLicense(license: String, promise: Promise) {
|
|
16
17
|
impl.initLicense(license, promise)
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
@ReactMethod
|
|
21
|
+
fun setDeviceFriendlyName(deviceFriendlyName: String) {
|
|
22
|
+
impl.setDeviceFriendlyName(deviceFriendlyName)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ReactMethod
|
|
26
|
+
fun getDeviceUUID(promise: Promise) {
|
|
27
|
+
impl.getDeviceUUID(promise)
|
|
28
|
+
}
|
|
18
29
|
}
|
|
@@ -26,4 +26,14 @@ class LicenseModuleImpl(private val reactContext: ReactApplicationContext) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
@ReactMethod
|
|
31
|
+
fun setDeviceFriendlyName(deviceFriendlyName: String) {
|
|
32
|
+
LicenseManager.setDeviceFriendlyName(deviceFriendlyName)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@ReactMethod
|
|
36
|
+
fun getDeviceUUID(promise: Promise) {
|
|
37
|
+
promise.resolve(LicenseManager.getDeviceUUID())
|
|
38
|
+
}
|
|
29
39
|
}
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
18
|
s.requires_arc = true
|
|
19
19
|
|
|
20
|
-
s.dependency "DynamsoftCaptureVisionBundle", ">= 3.4.
|
|
20
|
+
s.dependency "DynamsoftCaptureVisionBundle", ">= 3.4.1100", "< 4.0"
|
|
21
21
|
|
|
22
22
|
install_modules_dependencies(s)
|
|
23
23
|
end
|
package/ios/RNDynamsoftLicense.m
CHANGED
|
@@ -47,4 +47,15 @@ RCT_EXPORT_METHOD(initLicense:(NSString *)license
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
RCT_EXPORT_METHOD(setDeviceFriendlyName:(NSString *)name) {
|
|
51
|
+
[DSLicenseManager setDeviceFriendlyName:name];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
RCT_EXPORT_METHOD(getDeviceUUID:(RCTPromiseResolveBlock)resolve
|
|
55
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
56
|
+
{
|
|
57
|
+
NSString *uuid = [DSLicenseManager getDeviceUUID];
|
|
58
|
+
resolve(uuid);
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
@end
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dynamsoft-capture-vision-react-native",
|
|
3
3
|
"title": "Dynamsoft Capture Vision React Native",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1100",
|
|
5
5
|
"description": "The Dynamsoft Capture Vision React Native SDK provides a wrapper for building barcode scanning, document scanning and MRZ scanning applications with React Native.",
|
|
6
6
|
"homepage": "https://github.com/Dynamsoft/capture-vision-react-native-samples",
|
|
7
7
|
"main": "src/index.tsx",
|
|
@@ -30,4 +30,20 @@ export class LicenseManager {
|
|
|
30
30
|
static initLicense(license: string): Promise<void> {
|
|
31
31
|
return DynamsoftLicenseModule.initLicense(license)
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Sets a friendly name for the device, which can be used for easier identification in license management.
|
|
36
|
+
* @param name - The friendly name to be set for the device.
|
|
37
|
+
* */
|
|
38
|
+
static setDeviceFriendlyName(name: string) {
|
|
39
|
+
DynamsoftLicenseModule.setDeviceFriendlyName(name)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves the unique identifier (UUID) of the device, which is often used in license management to associate licenses with specific devices.
|
|
44
|
+
* @return Promise<string> - A promise that resolves with the device UUID as a string.
|
|
45
|
+
* */
|
|
46
|
+
static getDeviceUUID(): Promise<string> {
|
|
47
|
+
return DynamsoftLicenseModule.getDeviceUUID()
|
|
48
|
+
}
|
|
33
49
|
}
|