dynamsoft-capture-vision-react-native 1.1.13 → 1.1.15

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.
@@ -79,7 +79,7 @@ public class RNDCECameraView extends DCECameraView implements LifecycleEventList
79
79
  Field declaredField = DCECameraView.class.getDeclaredField("imgTorchClose");
80
80
  declaredField.setAccessible(true);
81
81
  Drawable closeDrawable = (Drawable)declaredField.get(this);
82
- View btnTorch = findViewById(R.id.btn_torch);
82
+ View btnTorch = findViewById(com.dynamsoft.dce.R.id.btn_torch);
83
83
  if(btnTorch != null) {
84
84
  btnTorch.setBackground(closeDrawable);
85
85
  }
@@ -74,10 +74,10 @@ public class RNDCECameraViewManager extends ViewGroupManager<RNDCECameraView> {
74
74
  @ReactProp(name = "cameraPosition")
75
75
  public void setCameraPosition(RNDCECameraView view, int cameraPosition) {
76
76
  EnumCameraPosition position = null;
77
- if(cameraPosition == 0) {
78
- position = EnumCameraPosition.CP_BACK;
79
- } else {
77
+ if(cameraPosition == 1) {
80
78
  position = EnumCameraPosition.CP_FRONT;
79
+ } else {
80
+ position = EnumCameraPosition.CP_BACK;
81
81
  }
82
82
  try {
83
83
  mCamera.selectCamera(position);
@@ -243,4 +243,4 @@ public class RNDCECameraViewManager extends ViewGroupManager<RNDCECameraView> {
243
243
  break;
244
244
  }
245
245
  }
246
- }
246
+ }
@@ -1,31 +1,28 @@
1
1
 
2
2
  package com.dynamsoft.reactlibrary;
3
3
 
4
-
5
- import java.util.Arrays;
6
- import java.util.Collections;
7
- import java.util.List;
8
-
9
- import com.dynamsoft.dce.CameraEnhancer;
10
4
  import com.facebook.react.ReactPackage;
5
+ import com.facebook.react.bridge.JavaScriptModule;
11
6
  import com.facebook.react.bridge.NativeModule;
12
7
  import com.facebook.react.bridge.ReactApplicationContext;
13
8
  import com.facebook.react.uimanager.ViewManager;
14
- import com.facebook.react.bridge.JavaScriptModule;
9
+
10
+ import java.util.Arrays;
11
+ import java.util.Collections;
12
+ import java.util.List;
15
13
  public class RNDynamsoftCaptrueVisionPackage implements ReactPackage {
16
- CameraEnhancer mCamera;
17
14
  RNDynamsoftBarcodeReaderModule mDbrModule;
18
15
  RNDCECameraViewManager mDCEViewManager;
19
16
 
20
17
  @Override
21
18
  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
22
19
  mDbrModule = new RNDynamsoftBarcodeReaderModule(reactContext);
23
- return Arrays.<NativeModule>asList(mDbrModule);
20
+ return Arrays.<NativeModule>asList(mDbrModule, new DCVFeedbackModule(reactContext));
24
21
  }
25
22
 
26
23
  // Deprecated from RN 0.47
27
24
  public List<Class<? extends JavaScriptModule>> createJSModules() {
28
- return Collections.emptyList();
25
+ return Collections.emptyList();
29
26
  }
30
27
 
31
28
  @Override
@@ -33,4 +30,4 @@ public class RNDynamsoftCaptrueVisionPackage implements ReactPackage {
33
30
  mDCEViewManager = new RNDCECameraViewManager(reactContext, mDbrModule);
34
31
  return Arrays.<ViewManager>asList(mDCEViewManager);
35
32
  }
36
- }
33
+ }
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
15
15
  s.requires_arc = true
16
16
  s.module_name = "RNDynamsoftCaptureVision"
17
17
  s.header_dir = "RNDynamsoftCaptureVision"
18
- s.dependency 'DynamsoftCameraEnhancer', '= 2.3.20'
18
+ s.dependency 'DynamsoftCameraEnhancer', '= 2.3.22'
19
19
  s.dependency 'DynamsoftBarcodeReader', '= 9.6.21'
20
20
 
21
21
  s.dependency "React"
@@ -127,12 +127,12 @@
127
127
  }
128
128
 
129
129
  - (void)setCameraPosition:(int)cameraPosition{
130
- _cameraPosition = cameraPosition;
131
130
  NSError *error;
132
- if (cameraPosition == 0) {
133
- [[StaticClass instance].dce selectCameraWithPosition:EnumCameraPositionBack error:&error];
134
- }else if (cameraPosition == 1){
135
- [[StaticClass instance].dce selectCameraWithPosition:EnumCameraPositionFront error:&error];
131
+ [[StaticClass instance].dce selectCameraWithPosition:cameraPosition error:&error];
132
+ if (error) {
133
+ NSLog(@"selectCameraWithPosition error: %@", error);
134
+ } else {
135
+ _cameraPosition = cameraPosition;
136
136
  }
137
137
  }
138
138
 
@@ -13,11 +13,11 @@ NS_ASSUME_NONNULL_BEGIN
13
13
 
14
14
  @interface StaticClass : NSObject
15
15
 
16
- @property (nonatomic, strong) DynamsoftBarcodeReader *dbr;
16
+ @property (nonatomic, strong, nullable) DynamsoftBarcodeReader *dbr;
17
17
 
18
- @property (nonatomic, strong) DynamsoftCameraEnhancer *dce;
18
+ @property (nonatomic, strong, nullable) DynamsoftCameraEnhancer *dce;
19
19
 
20
- @property (nonatomic, strong) DCECameraView *view;
20
+ @property (nonatomic, strong, nullable) DCECameraView *view;
21
21
 
22
22
  + (StaticClass *)instance;
23
23
 
@@ -7,6 +7,7 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 6810C0592C3CDCC80037457B /* RCTDynamsoftFeedback.m in Sources */ = {isa = PBXBuildFile; fileRef = 6810C0582C3CDCC80037457B /* RCTDynamsoftFeedback.m */; };
10
11
  841E4B6727E9B890006D0011 /* RCTDynamsoftBarcodeReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 841E4B6627E9B890006D0011 /* RCTDynamsoftBarcodeReader.m */; };
11
12
  841E4B6827E9B890006D0011 /* RCTDynamsoftBarcodeReader.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 841E4B6527E9B890006D0011 /* RCTDynamsoftBarcodeReader.h */; };
12
13
  841E4B7027E9B8EE006D0011 /* DYSCameraView.m in Sources */ = {isa = PBXBuildFile; fileRef = 841E4B6F27E9B8EE006D0011 /* DYSCameraView.m */; };
@@ -30,6 +31,8 @@
30
31
  /* End PBXCopyFilesBuildPhase section */
31
32
 
32
33
  /* Begin PBXFileReference section */
34
+ 6810C0572C3CDCC80037457B /* RCTDynamsoftFeedback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDynamsoftFeedback.h; sourceTree = "<group>"; };
35
+ 6810C0582C3CDCC80037457B /* RCTDynamsoftFeedback.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDynamsoftFeedback.m; sourceTree = "<group>"; };
33
36
  841E4B6227E9B890006D0011 /* libRNDynamsoftCaptureVision.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNDynamsoftCaptureVision.a; sourceTree = BUILT_PRODUCTS_DIR; };
34
37
  841E4B6527E9B890006D0011 /* RCTDynamsoftBarcodeReader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTDynamsoftBarcodeReader.h; sourceTree = "<group>"; };
35
38
  841E4B6627E9B890006D0011 /* RCTDynamsoftBarcodeReader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTDynamsoftBarcodeReader.m; sourceTree = "<group>"; };
@@ -82,6 +85,8 @@
82
85
  841E4B6F27E9B8EE006D0011 /* DYSCameraView.m */,
83
86
  841E4B7127E9B905006D0011 /* DYSCameraViewManager.h */,
84
87
  841E4B7227E9B905006D0011 /* DYSCameraViewManager.m */,
88
+ 6810C0572C3CDCC80037457B /* RCTDynamsoftFeedback.h */,
89
+ 6810C0582C3CDCC80037457B /* RCTDynamsoftFeedback.m */,
85
90
  8489B57727EB2042001314E0 /* StaticClass.h */,
86
91
  8489B57827EB2042001314E0 /* StaticClass.m */,
87
92
  );
@@ -158,6 +163,7 @@
158
163
  841E4B7327E9B905006D0011 /* DYSCameraViewManager.m in Sources */,
159
164
  8489B57927EB2042001314E0 /* StaticClass.m in Sources */,
160
165
  841E4B6727E9B890006D0011 /* RCTDynamsoftBarcodeReader.m in Sources */,
166
+ 6810C0592C3CDCC80037457B /* RCTDynamsoftFeedback.m in Sources */,
161
167
  );
162
168
  runOnlyForDeploymentPostprocessing = 0;
163
169
  };
@@ -1,44 +1,46 @@
1
1
  import { Rect } from "./BasicStructures";
2
2
  export interface TorchButton {
3
3
  /**
4
- * Defines the location of the torch button.
5
- */
4
+ * Defines the location of the torch button.
5
+ */
6
6
  location: Rect;
7
7
  /**
8
- * True: the torch will be displayed.
9
- * False: the torch will be hide.
10
- */
8
+ * True: the torch will be displayed.
9
+ * False: the torch will be hide.
10
+ */
11
11
  visible: boolean;
12
12
  /**
13
- * A base 64 string that specify the torch on image.
14
- * When the torch is on, this image will be displayed as the torch image.
15
- */
13
+ * A base 64 string that specify the torch on image.
14
+ * When the torch is on, this image will be displayed as the torch image.
15
+ */
16
16
  torchOnImageBase64: string;
17
17
  /**
18
- * A base 64 string that specify the torch off image.
19
- * When the torch is off, this image will be displayed as the torch image.
20
- */
18
+ * A base 64 string that specify the torch off image.
19
+ * When the torch is off, this image will be displayed as the torch image.
20
+ */
21
21
  torchOffImageBase64: string;
22
22
  }
23
23
  export declare enum EnumTorchState {
24
24
  /**
25
- * Set the torch state to off.
26
- */
25
+ * Set the torch state to off.
26
+ */
27
27
  OFF = 0,
28
28
  /**
29
- * Set the torch state to on.
30
- */
29
+ * Set the torch state to on.
30
+ */
31
31
  ON = 1
32
32
  }
33
33
  export declare enum EnumCameraPosition {
34
34
  /**
35
- * Use the back-facing camera.
36
- */
35
+ * Use the back-facing camera.
36
+ */
37
37
  CP_BACK = 0,
38
38
  /**
39
- * Use the front-facing camera.
40
- */
41
- CP_FRONT = 1
39
+ * Use the front-facing camera.
40
+ */
41
+ CP_FRONT = 1,
42
+ CP_BACK_ULTRA_WIDE = 2, //IOS only
43
+ CP_BACK_DUAL_WIDE_AUTO = 3 //IOS only
42
44
  }
43
45
  export declare enum EnumEnhancedFeatures {
44
46
  EF_FRAME_FILTER = 1,
@@ -4,24 +4,26 @@ exports.EnumEnhancedFeatures = exports.EnumCameraPosition = exports.EnumTorchSta
4
4
  var EnumTorchState;
5
5
  (function (EnumTorchState) {
6
6
  /**
7
- * Set the torch state to off.
8
- */
7
+ * Set the torch state to off.
8
+ */
9
9
  EnumTorchState[EnumTorchState["OFF"] = 0] = "OFF";
10
10
  /**
11
- * Set the torch state to on.
12
- */
11
+ * Set the torch state to on.
12
+ */
13
13
  EnumTorchState[EnumTorchState["ON"] = 1] = "ON";
14
14
  })(EnumTorchState = exports.EnumTorchState || (exports.EnumTorchState = {}));
15
15
  var EnumCameraPosition;
16
16
  (function (EnumCameraPosition) {
17
17
  /**
18
- * Use the back-facing camera.
19
- */
18
+ * Use the back-facing camera.
19
+ */
20
20
  EnumCameraPosition[EnumCameraPosition["CP_BACK"] = 0] = "CP_BACK";
21
21
  /**
22
- * Use the front-facing camera.
23
- */
22
+ * Use the front-facing camera.
23
+ */
24
24
  EnumCameraPosition[EnumCameraPosition["CP_FRONT"] = 1] = "CP_FRONT";
25
+ EnumCameraPosition[EnumCameraPosition["CP_BACK_ULTRA_WIDE"] = 2] = "CP_BACK_ULTRA_WIDE";
26
+ EnumCameraPosition[EnumCameraPosition["CP_BACK_DUAL_WIDE_AUTO"] = 3] = "CP_BACK_DUAL_WIDE_AUTO";
25
27
  })(EnumCameraPosition = exports.EnumCameraPosition || (exports.EnumCameraPosition = {}));
26
28
  var EnumEnhancedFeatures;
27
29
  (function (EnumEnhancedFeatures) {
@@ -1 +1 @@
1
- {"version":3,"file":"CameraSettings.js","sourceRoot":"","sources":["CameraSettings.tsx"],"names":[],"mappings":";;;AAyBA,IAAY,cASX;AATD,WAAY,cAAc;IACtB;;MAEE;IACF,iDAAG,CAAA;IACH;;MAEE;IACF,+CAAE,CAAA;AACN,CAAC,EATW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QASzB;AAED,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC1B;;MAEE;IACF,iEAAO,CAAA;IACP;;MAEE;IACF,mEAAQ,CAAA;AACZ,CAAC,EATW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAS7B;AAED,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC5B,qFAAmB,CAAA;IACnB,yFAAqB,CAAA;IACrB,yFAAqB,CAAA;IACrB,+EAAe,CAAA;IACf,gFAAiB,CAAA;IACjB,oFAAmB,CAAA;IACnB,oEAAW,CAAA;AACf,CAAC,EARW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAQ/B"}
1
+ {"version":3,"file":"CameraSettings.js","sourceRoot":"","sources":["CameraSettings.tsx"],"names":[],"mappings":";;;AAyBA,IAAY,cASX;AATD,WAAY,cAAc;IACtB;;OAEG;IACH,iDAAG,CAAA;IACH;;OAEG;IACH,+CAAE,CAAA;AACN,CAAC,EATW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QASzB;AAED,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAC1B;;OAEG;IACH,iEAAO,CAAA;IACP;;OAEG;IACH,mEAAQ,CAAA;IACR,6EAAa,CAAA;IACb,6EAAa,CAAA;IACb,2EAAY,CAAA;IACZ,2EAAY,CAAA;IACZ,qEAAS,CAAA,CAAC,UAAU;AACxB,CAAC,EAdW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAc7B;AAED,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC5B,qFAAmB,CAAA;IACnB,yFAAqB,CAAA;IACrB,yFAAqB,CAAA;IACrB,+EAAgB,CAAA;IAChB,gFAAiB,CAAA;IACjB,oFAAmB,CAAA;IACnB,oEAAW,CAAA;AACf,CAAC,EARW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAQ/B"}
@@ -1,55 +1,57 @@
1
- import { Rect } from "./BasicStructures";
1
+ import {Rect} from "./BasicStructures";
2
2
 
3
3
  export interface TorchButton {
4
4
  /**
5
- * Defines the location of the torch button.
6
- */
5
+ * Defines the location of the torch button.
6
+ */
7
7
  location: Rect;
8
8
  /**
9
- * True: the torch will be displayed.
10
- * False: the torch will be hide.
11
- */
9
+ * True: the torch will be displayed.
10
+ * False: the torch will be hide.
11
+ */
12
12
  visible: boolean;
13
13
  /**
14
- * A base 64 string that specify the torch on image.
15
- * When the torch is on, this image will be displayed as the torch image.
16
- */
14
+ * A base 64 string that specify the torch on image.
15
+ * When the torch is on, this image will be displayed as the torch image.
16
+ */
17
17
  torchOnImageBase64: string;
18
18
  /**
19
- * A base 64 string that specify the torch off image.
20
- * When the torch is off, this image will be displayed as the torch image.
21
- */
19
+ * A base 64 string that specify the torch off image.
20
+ * When the torch is off, this image will be displayed as the torch image.
21
+ */
22
22
  torchOffImageBase64: string;
23
23
  }
24
24
 
25
25
 
26
26
  export enum EnumTorchState {
27
27
  /**
28
- * Set the torch state to off.
29
- */
28
+ * Set the torch state to off.
29
+ */
30
30
  OFF,
31
31
  /**
32
- * Set the torch state to on.
33
- */
32
+ * Set the torch state to on.
33
+ */
34
34
  ON
35
35
  }
36
36
 
37
37
  export enum EnumCameraPosition {
38
38
  /**
39
- * Use the back-facing camera.
40
- */
41
- CP_BACK,
39
+ * Use the back-facing camera.
40
+ */
41
+ CP_BACK = 0,
42
42
  /**
43
- * Use the front-facing camera.
44
- */
45
- CP_FRONT
43
+ * Use the front-facing camera.
44
+ */
45
+ CP_FRONT = 1,
46
+ CP_BACK_ULTRA_WIDE = 2, //IOS only
47
+ CP_BACK_DUAL_WIDE_AUTO = 3 //IOS only
46
48
  }
47
49
 
48
50
  export enum EnumEnhancedFeatures {
49
51
  EF_FRAME_FILTER = 1,
50
52
  EF_SENSOR_CONTROL = 2,
51
53
  EF_ENHANCED_FOCUS = 4,
52
- EF_FAST_MODE= 8,
54
+ EF_FAST_MODE = 8,
53
55
  EF_AUTO_ZOOM = 16,
54
56
  EF_SMART_TORCH = 32,
55
57
  EF_ALL = 63
package/js/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './DynamsoftBarcodeReader';
4
4
  export * from './DynamsoftCameraView';
5
5
  export * from './BarcodeResult';
6
6
  export * from './BasicStructures';
7
+ export * from './DCVFeedback';
package/js/index.js CHANGED
@@ -20,4 +20,5 @@ __exportStar(require("./DynamsoftBarcodeReader"), exports);
20
20
  __exportStar(require("./DynamsoftCameraView"), exports);
21
21
  __exportStar(require("./BarcodeResult"), exports);
22
22
  __exportStar(require("./BasicStructures"), exports);
23
+ __exportStar(require("./DCVFeedback"), exports);
23
24
  //# sourceMappingURL=index.js.map
package/js/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC;AAChC,oDAAiC;AACjC,2DAAwC;AACxC,wDAAqC;AACrC,kDAA+B;AAC/B,oDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC;AAChC,oDAAiC;AACjC,2DAAwC;AACxC,wDAAqC;AACrC,kDAA+B;AAC/B,oDAAiC;AACjC,gDAA6B"}
package/js/index.tsx CHANGED
@@ -3,4 +3,5 @@ export * from './BarcodeSettings'
3
3
  export * from './DynamsoftBarcodeReader'
4
4
  export * from './DynamsoftCameraView'
5
5
  export * from './BarcodeResult'
6
- export * from './BasicStructures'
6
+ export * from './BasicStructures'
7
+ export * from './DCVFeedback'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamsoft-capture-vision-react-native",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "Dynamsoft Capture Vision React Native SDK",
5
5
  "homepage": "https://www.dynamsoft.com/capture-vision/docs/introduction",
6
6
  "main": "./js/index.js",
@@ -38,5 +38,8 @@
38
38
  "@types/react-native": "^0.68.0",
39
39
  "@types/react-test-renderer": "^18.0.0",
40
40
  "typescript": "^4.7.4"
41
+ },
42
+ "dependencies": {
43
+ "dynamsoft-capture-vision-react-native": "^1.1.15"
41
44
  }
42
45
  }