anyline-ocr-react-native-module 42.2.0 → 43.0.0

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.
Files changed (51) hide show
  1. package/android/build.gradle +7 -3
  2. package/android/src/main/AndroidManifest.xml +9 -8
  3. package/android/src/main/assets/cow_tag_scanner.ale +46 -0
  4. package/android/src/main/java/com/anyline/reactnative/AnylinePackage.java +1 -2
  5. package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +25 -71
  6. package/android/src/main/java/com/anyline/reactnative/RotateButtonConfig.java +12 -2
  7. package/android/src/main/java/com/anyline/reactnative/ScanActivity.java +206 -0
  8. package/android/src/main/res/drawable/rotate_screen_background.xml +18 -0
  9. package/android/src/main/res/drawable/rotate_screen_white.png +0 -0
  10. package/android/src/main/res/layout/activity_scan.xml +27 -0
  11. package/android/src/main/res/values/anyline_sdk_plugin_strings.xml +2 -28
  12. package/ios/ALJsonUIConfiguration.h +29 -36
  13. package/ios/ALJsonUIConfiguration.m +136 -76
  14. package/ios/ALNFCScanViewController.h +3 -16
  15. package/ios/ALNFCScanViewController.m +361 -232
  16. package/ios/ALPluginHelper.h +19 -62
  17. package/ios/ALPluginHelper.m +208 -529
  18. package/ios/ALPluginScanViewController.h +5 -32
  19. package/ios/ALPluginScanViewController.m +339 -287
  20. package/ios/AnylineReact.podspec +4 -3
  21. package/ios/AnylineSDKPlugin.m +39 -82
  22. package/package.json +8 -8
  23. package/android/.gradle/6.7/executionHistory/executionHistory.lock +0 -0
  24. package/android/.gradle/6.7/fileChanges/last-build.bin +0 -0
  25. package/android/.gradle/6.7/fileHashes/fileHashes.bin +0 -0
  26. package/android/.gradle/6.7/fileHashes/fileHashes.lock +0 -0
  27. package/android/.gradle/6.7/gc.properties +0 -0
  28. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  29. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  30. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  31. package/android/.gradle/checksums/checksums.lock +0 -0
  32. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  33. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  34. package/android/.gradle/configuration-cache/gc.properties +0 -0
  35. package/android/.gradle/vcs-1/gc.properties +0 -0
  36. package/android/.idea/compiler.xml +0 -6
  37. package/android/.idea/gradle.xml +0 -18
  38. package/android/.idea/jarRepositories.xml +0 -35
  39. package/android/.idea/misc.xml +0 -10
  40. package/android/.idea/vcs.xml +0 -6
  41. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  42. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  43. package/android/local.properties +0 -8
  44. package/android/src/main/java/com/anyline/reactnative/Anyline4Activity.java +0 -621
  45. package/android/src/main/java/com/anyline/reactnative/AnylineBaseActivity.java +0 -267
  46. package/android/src/main/java/com/anyline/reactnative/AnylinePluginHelper.java +0 -324
  47. package/android/src/main/java/com/anyline/reactnative/AnylineUIConfig.java +0 -88
  48. package/android/src/main/java/com/anyline/reactnative/Document4Activity.java +0 -595
  49. package/android/src/main/res/layout/activity_scan_document.xml +0 -63
  50. package/android/src/main/res/layout/activity_scan_scanview.xml +0 -52
  51. package/android/src/main/res/values/com_crashlytics_export_strings.xml +0 -10
@@ -1,11 +1,3 @@
1
- //
2
- // ALJsonUIConfiguration.h
3
- // FoodNotifyBussines
4
- //
5
- // Created by Matthias Gasser on 12/11/15.
6
- //
7
- //
8
-
9
1
  #import <Foundation/Foundation.h>
10
2
  #import <UIKit/UIKit.h>
11
3
 
@@ -21,41 +13,42 @@ typedef NS_ENUM(NSUInteger, ALButtonYAlignment) {
21
13
  ALButtonYAlignmentBottom=2
22
14
  };
23
15
 
24
-
25
16
  typedef NS_ENUM(NSUInteger, ALButtonType) {
26
17
  ALButtonTypeFullWidth=0,
27
18
  ALButtonTypeRect=1,
28
19
  };
29
20
 
30
21
 
31
- @interface ALJsonUIConfiguration : NSObject
22
+ @interface ALJSONUIConfiguration : NSObject
32
23
 
33
24
  // Done Button
34
- @property (nonatomic,strong) NSString *buttonDoneTitle;
35
- @property (nonatomic,assign) CGFloat buttonDoneFontSize;
36
- @property (nonatomic,strong) NSString *buttonDoneFontName;
37
- @property (nonatomic,strong) UIColor *buttonDoneTextColor;
38
- @property (nonatomic,strong) UIColor *buttonDoneTextColorHighlighted;
39
- @property (nonatomic,strong) UIColor *buttonDoneBackgroundColor;
40
- @property (nonatomic,assign) ALButtonType buttonType;
41
- @property (nonatomic,assign) CGFloat buttonDoneCornerRadius;
42
- @property (nonatomic,assign) ALButtonXAlignment buttonDoneXAlignment;
43
- @property (nonatomic,assign) ALButtonYAlignment buttonDoneYAlignment;
44
- @property (nonatomic,assign) CGFloat buttonDoneXPositionOffset;
45
- @property (nonatomic,assign) CGFloat buttonDoneYPositionOffset;
46
-
47
- @property (nonatomic,strong) NSArray<NSString *> *segmentTitles;
48
- @property (nonatomic,strong) NSArray<NSString *> *segmentModes;
49
- @property (nonatomic,strong) UIColor *segmentTintColor;
50
- @property (nonatomic,assign) CGFloat segmentXPositionOffset;
51
- @property (nonatomic,assign) CGFloat segmentYPositionOffset;
52
-
53
- @property (nonatomic,strong) NSString *labelText;
54
- @property (nonatomic,assign) CGFloat labelSize;
55
- @property (nonatomic,strong) UIColor *labelColor;
56
- @property (nonatomic,assign) CGFloat labelXPositionOffset;
57
- @property (nonatomic,assign) CGFloat labelYPositionOffset;
58
-
59
- -(instancetype) initWithDictionary:(NSDictionary*)dictionary;
25
+ @property (nonatomic, strong) NSString *buttonDoneTitle;
26
+ @property (nonatomic, assign) CGFloat buttonDoneFontSize;
27
+ @property (nonatomic, strong) NSString *buttonDoneFontName;
28
+ @property (nonatomic, strong) UIColor *buttonDoneTextColor;
29
+ @property (nonatomic, strong) UIColor *buttonDoneTextColorHighlighted;
30
+ @property (nonatomic, strong) UIColor *buttonDoneBackgroundColor;
31
+ @property (nonatomic, assign) ALButtonType buttonType;
32
+ @property (nonatomic, assign) CGFloat buttonDoneCornerRadius;
33
+ @property (nonatomic, assign) ALButtonXAlignment buttonDoneXAlignment;
34
+ @property (nonatomic, assign) ALButtonYAlignment buttonDoneYAlignment;
35
+ @property (nonatomic, assign) CGFloat buttonDoneXPositionOffset;
36
+ @property (nonatomic, assign) CGFloat buttonDoneYPositionOffset;
37
+
38
+ @property (nonatomic, strong) NSArray<NSString *> *segmentTitles;
39
+ @property (nonatomic, strong) NSArray<NSString *> *segmentModes;
40
+ @property (nonatomic, strong) UIColor *segmentTintColor;
41
+ @property (nonatomic, assign) CGFloat segmentXPositionOffset;
42
+ @property (nonatomic, assign) CGFloat segmentYPositionOffset;
43
+
44
+ @property (nonatomic, strong) NSString *labelText;
45
+ @property (nonatomic, assign) CGFloat labelSize;
46
+ @property (nonatomic, strong) UIColor *labelColor;
47
+ @property (nonatomic, assign) CGFloat labelXPositionOffset;
48
+ @property (nonatomic, assign) CGFloat labelYPositionOffset;
49
+
50
+ @property (nonatomic, strong) NSArray<NSString *> *nativeBarcodeFormats;
51
+
52
+ - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
60
53
 
61
54
  @end
@@ -1,14 +1,7 @@
1
- //
2
- // ALJsonUIConfiguration.m
3
- // FoodNotifyBussines
4
- //
5
- // Created by Matthias Gasser on 12/11/15.
6
- //
7
- //
1
+ #import "ALJSONUIConfiguration.h"
2
+ #import <Anyline/Anyline.h>
8
3
 
9
- #import "ALJsonUIConfiguration.h"
10
-
11
- NSString * const DONE_BUTTON = @"doneButton";
4
+ NSString * const DONE_BUTTON = @"doneButtonConfig";
12
5
  NSString * const DONE_BUTTON_TITLE = @"title";
13
6
  NSString * const DONE_BUTTON_COLOR = @"textColor";
14
7
  NSString * const DONE_BUTTON_COLOR_HIGHLIGHTED = @"textColorHighlighted";
@@ -20,7 +13,7 @@ NSString * const DONE_BUTTON_BACKGROUND_COLOR = @"backgroundColor";
20
13
  NSString * const DONE_BUTTON_TYPE = @"type";
21
14
  NSString * const DONE_BUTTON_CORNER_RADIUS = @"cornerRadius";
22
15
 
23
- NSString * const SEGMENT = @"segment";
16
+ NSString * const SEGMENT = @"segmentConfig";
24
17
  NSString * const SEGMENT_TITLES = @"titles";
25
18
  NSString * const SEGMENT_MODES = @"modes";
26
19
  NSString * const SEGMENT_TINT_COLOR = @"tintColor";
@@ -29,7 +22,7 @@ NSString * const OFFSET = @"offset";
29
22
  NSString * const OFFSET_X = @"offset.x";
30
23
  NSString * const OFFSET_Y = @"offset.y";
31
24
 
32
- NSString * const LABEL = @"label";
25
+ NSString * const LABEL = @"labelConfig";
33
26
  NSString * const LABEL_TEXT = @"text";
34
27
  NSString * const LABEL_COLOR = @"color";
35
28
  NSString * const LABEL_SIZE = @"size";
@@ -38,12 +31,14 @@ NSString * const LABEL_OFFSET = @"labelOffset";
38
31
  NSString * const LABEL_OFFSET_X = @"offset.x";
39
32
  NSString * const LABEL_OFFSET_Y = @"offset.y";
40
33
 
41
- @implementation ALJsonUIConfiguration
34
+ NSString * const ENABLE_NATIVE_BARCODE = @"nativeBarcodeScanningFormats";
35
+
36
+ @implementation ALJSONUIConfiguration
37
+
38
+ - (instancetype)initWithDictionary:(NSDictionary *)dictionary {
39
+ if (self = [super init]) {
42
40
 
43
- -(instancetype)initWithDictionary:(NSDictionary *)dictionary {
44
- self = [super init];
45
- if(self) {
46
- _buttonDoneFontName = @"HelveticaNeue";
41
+ _buttonDoneFontName = @"Avenir Next"; // @"HelveticaNeue";
47
42
  _buttonDoneTextColor = [UIColor whiteColor];
48
43
  _buttonDoneTextColorHighlighted = [UIColor grayColor];
49
44
  _buttonDoneBackgroundColor = [UIColor clearColor];
@@ -55,132 +50,197 @@ NSString * const LABEL_OFFSET_Y = @"offset.y";
55
50
  _buttonDoneYPositionOffset = -88.0;
56
51
  _buttonDoneXPositionOffset = 0;
57
52
  _buttonDoneCornerRadius = 4.0;
53
+
54
+ _labelSize = 32.0f;
55
+ _labelText = @"";
56
+ _labelColor = UIColor.whiteColor;
57
+ _labelXPositionOffset = 0.0f;
58
+ _labelYPositionOffset = 0.0f;
59
+
60
+ _nativeBarcodeFormats = @[];
61
+
62
+ if ([dictionary valueForKey:ENABLE_NATIVE_BARCODE]) {
63
+ NSArray<NSString *> *formats = [dictionary valueForKey:ENABLE_NATIVE_BARCODE];
64
+
65
+ NSMutableArray *nativeBarcodeFormats = [NSMutableArray arrayWithCapacity:formats.count];
66
+
67
+ for (NSString *format in formats) {
68
+ NSString *nativeBarcodeFormat = [self.class barcodeFormatToNativeString:format];
69
+ if (nativeBarcodeFormat) {
70
+ [nativeBarcodeFormats addObject:nativeBarcodeFormat];
71
+ }
72
+ }
73
+
74
+ self.nativeBarcodeFormats = nativeBarcodeFormats;
75
+ }
58
76
 
59
- if([dictionary valueForKey:DONE_BUTTON]) {
77
+ if ([dictionary valueForKey:DONE_BUTTON]) {
60
78
  NSDictionary *btnDict = [dictionary valueForKey:DONE_BUTTON];
61
79
 
62
- if([btnDict valueForKey:DONE_BUTTON_FONT_NAME])
80
+ if ([btnDict valueForKey:DONE_BUTTON_FONT_NAME]) {
63
81
  _buttonDoneFontName = [btnDict valueForKeyPath:DONE_BUTTON_FONT_NAME];
82
+ }
83
+
84
+ if ([btnDict valueForKey:DONE_BUTTON_COLOR]) {
85
+ _buttonDoneTextColor = [ALJSONUIConfiguration colorFromHexString:[btnDict valueForKeyPath:DONE_BUTTON_COLOR]];
86
+ }
64
87
 
65
- if([btnDict valueForKey:DONE_BUTTON_COLOR])
66
- _buttonDoneTextColor = [ALJsonUIConfiguration colorFromHexString:[btnDict valueForKeyPath:DONE_BUTTON_COLOR]];
67
-
68
- if([btnDict valueForKey:DONE_BUTTON_COLOR_HIGHLIGHTED])
69
- _buttonDoneTextColorHighlighted = [ALJsonUIConfiguration colorFromHexString:[btnDict valueForKeyPath:DONE_BUTTON_COLOR_HIGHLIGHTED]];
70
-
88
+ if ([btnDict valueForKey:DONE_BUTTON_COLOR_HIGHLIGHTED]) {
89
+ _buttonDoneTextColorHighlighted = [ALJSONUIConfiguration colorFromHexString:[btnDict valueForKeyPath:DONE_BUTTON_COLOR_HIGHLIGHTED]];
90
+ }
71
91
 
72
- if([btnDict valueForKey:DONE_BUTTON_FONT_SIZE])
92
+ if ([btnDict valueForKey:DONE_BUTTON_FONT_SIZE]) {
73
93
  _buttonDoneFontSize = [[btnDict valueForKeyPath:DONE_BUTTON_FONT_SIZE] floatValue];
94
+ }
74
95
 
75
- if([btnDict valueForKey:DONE_BUTTON_TYPE])
76
- _buttonType = [ALJsonUIConfiguration stringToButtonType:[btnDict valueForKeyPath:DONE_BUTTON_TYPE]];
96
+ if ([btnDict valueForKey:DONE_BUTTON_TYPE]) {
97
+ _buttonType = [ALJSONUIConfiguration stringToButtonType:[btnDict valueForKeyPath:DONE_BUTTON_TYPE]];
98
+ }
77
99
 
78
- if([btnDict valueForKey:DONE_BUTTON_BACKGROUND_COLOR])
79
- _buttonDoneBackgroundColor = [ALJsonUIConfiguration colorFromHexString:[btnDict valueForKey:DONE_BUTTON_BACKGROUND_COLOR]];
100
+ if ([btnDict valueForKey:DONE_BUTTON_BACKGROUND_COLOR]) {
101
+ _buttonDoneBackgroundColor = [ALJSONUIConfiguration colorFromHexString:[btnDict valueForKey:DONE_BUTTON_BACKGROUND_COLOR]];
102
+ }
80
103
 
81
- if([btnDict valueForKey:DONE_BUTTON_TITLE])
104
+ if ([btnDict valueForKey:DONE_BUTTON_TITLE]) {
82
105
  _buttonDoneTitle = [btnDict valueForKeyPath:DONE_BUTTON_TITLE];
83
-
84
- if([btnDict valueForKey:DONE_BUTTON_X_ALIGNMENT]) {
85
- _buttonDoneXAlignment = [ALJsonUIConfiguration stringToButtonXAlignment:[btnDict valueForKeyPath:DONE_BUTTON_X_ALIGNMENT]];
86
106
  }
87
107
 
88
- if([btnDict valueForKey:DONE_BUTTON_Y_ALIGNMENT]) {
89
- _buttonDoneYAlignment = [ALJsonUIConfiguration stringToButtonYAlignment:[btnDict valueForKeyPath:DONE_BUTTON_Y_ALIGNMENT]];
108
+ if ([btnDict valueForKey:DONE_BUTTON_X_ALIGNMENT]) {
109
+ _buttonDoneXAlignment = [ALJSONUIConfiguration stringToButtonXAlignment:[btnDict valueForKeyPath:DONE_BUTTON_X_ALIGNMENT]];
90
110
  }
91
111
 
92
-
93
- if([btnDict valueForKeyPath:OFFSET_X])
112
+ if ([btnDict valueForKey:DONE_BUTTON_Y_ALIGNMENT]) {
113
+ _buttonDoneYAlignment = [ALJSONUIConfiguration stringToButtonYAlignment:[btnDict valueForKeyPath:DONE_BUTTON_Y_ALIGNMENT]];
114
+ }
115
+
116
+ if ([btnDict valueForKeyPath:OFFSET_X]) {
94
117
  _buttonDoneXPositionOffset = [[btnDict valueForKeyPath:OFFSET_X] floatValue];
118
+ }
95
119
 
96
- if([btnDict valueForKeyPath:OFFSET_Y])
120
+ if ([btnDict valueForKeyPath:OFFSET_Y]) {
97
121
  _buttonDoneYPositionOffset = [[btnDict valueForKeyPath:OFFSET_Y] floatValue];
122
+ }
98
123
 
99
- if([btnDict valueForKey:DONE_BUTTON_CORNER_RADIUS])
124
+ if ([btnDict valueForKey:DONE_BUTTON_CORNER_RADIUS]) {
100
125
  _buttonDoneCornerRadius = [[btnDict valueForKeyPath:DONE_BUTTON_CORNER_RADIUS] floatValue];
101
-
126
+ }
102
127
  }
103
128
 
104
129
  if ([dictionary valueForKey:SEGMENT]) {
105
130
  NSDictionary *segDict = [dictionary valueForKey:SEGMENT];
106
131
 
107
- if([segDict valueForKey:SEGMENT_TITLES])
132
+ if ([segDict valueForKey:SEGMENT_TITLES]) {
108
133
  _segmentTitles = [segDict valueForKey:SEGMENT_TITLES];
134
+ }
109
135
 
110
- if([segDict valueForKey:SEGMENT_MODES])
136
+ if ([segDict valueForKey:SEGMENT_MODES]) {
111
137
  _segmentModes = [segDict valueForKey:SEGMENT_MODES];
138
+ }
112
139
 
113
- if([segDict valueForKey:SEGMENT_TINT_COLOR])
114
- _segmentTintColor = [ALJsonUIConfiguration colorFromHexString:[segDict valueForKey:SEGMENT_TINT_COLOR]];
140
+ if ([segDict valueForKey:SEGMENT_TINT_COLOR]) {
141
+ _segmentTintColor = [ALJSONUIConfiguration colorFromHexString:[segDict valueForKey:SEGMENT_TINT_COLOR]];
142
+ }
115
143
 
116
- if([segDict valueForKeyPath:OFFSET_X])
144
+ if ([segDict valueForKeyPath:OFFSET_X]) {
117
145
  _segmentXPositionOffset = [[segDict valueForKeyPath:OFFSET_X] floatValue];
146
+ }
118
147
 
119
- if([segDict valueForKeyPath:OFFSET_Y])
148
+ if ([segDict valueForKeyPath:OFFSET_Y]) {
120
149
  _segmentYPositionOffset = [[segDict valueForKeyPath:OFFSET_Y] floatValue];
150
+ }
121
151
  }
122
152
 
123
153
  if ([dictionary valueForKey:LABEL]) {
124
154
  NSDictionary *labDict = [dictionary valueForKey:LABEL];
125
155
 
126
- if([labDict valueForKey:LABEL_TEXT])
127
- _labelText = [labDict valueForKey:LABEL_TEXT];
156
+ if ([labDict valueForKey:LABEL_TEXT]) {
157
+ _labelText = [labDict valueForKey:LABEL_TEXT];
158
+ }
128
159
 
129
- if([labDict valueForKey:LABEL_SIZE])
130
- _labelSize = [[labDict valueForKeyPath:LABEL_SIZE] floatValue];
160
+ if ([labDict valueForKey:LABEL_SIZE]) {
161
+ _labelSize = [[labDict valueForKeyPath:LABEL_SIZE] floatValue];
162
+ }
131
163
 
132
- if([labDict valueForKey:LABEL_COLOR])
133
- _labelColor = [ALJsonUIConfiguration colorFromHexString:[labDict valueForKey:LABEL_COLOR]];
164
+ if ([labDict valueForKey:LABEL_COLOR]) {
165
+ _labelColor = [ALJSONUIConfiguration colorFromHexString:[labDict valueForKey:LABEL_COLOR]];
166
+ }
134
167
 
135
- if([labDict valueForKeyPath:LABEL_OFFSET_X])
136
- _labelXPositionOffset = [[labDict valueForKeyPath:LABEL_OFFSET_X] floatValue];
168
+ if ([labDict valueForKeyPath:LABEL_OFFSET_X]) {
169
+ _labelXPositionOffset = [[labDict valueForKeyPath:LABEL_OFFSET_X] floatValue];
170
+ }
137
171
 
138
- if([labDict valueForKeyPath:LABEL_OFFSET_Y])
139
- _labelYPositionOffset = [[labDict valueForKeyPath:LABEL_OFFSET_Y] floatValue];
172
+ if ([labDict valueForKeyPath:LABEL_OFFSET_Y]) {
173
+ _labelYPositionOffset = [[labDict valueForKeyPath:LABEL_OFFSET_Y] floatValue];
174
+ }
140
175
  }
141
176
 
142
177
  }
143
178
  return self;
144
179
  }
145
180
 
146
- +(ALButtonXAlignment) stringToButtonXAlignment:(NSString*) str {
181
+ + (ALButtonXAlignment)stringToButtonXAlignment:(NSString *)str {
147
182
  NSDictionary *map = @{
148
- @"LEFT":@(ALButtonXAlignmentLeft),
149
- @"CENTER":@(ALButtonXAlignmentCenter),
150
- @"RIGHT":@(ALButtonXAlignmentRight),
151
- };
183
+ @"LEFT": @(ALButtonXAlignmentLeft),
184
+ @"CENTER": @(ALButtonXAlignmentCenter),
185
+ @"RIGHT": @(ALButtonXAlignmentRight),
186
+ };
152
187
 
153
188
  return [[map valueForKey:str.uppercaseString] integerValue];
154
189
  }
155
190
 
156
- +(ALButtonYAlignment) stringToButtonYAlignment:(NSString*) str {
191
+ + (ALButtonYAlignment)stringToButtonYAlignment:(NSString *)str {
157
192
  NSDictionary *map = @{
158
- @"TOP":@(ALButtonYAlignmentTop),
159
- @"CENTER":@(ALButtonYAlignmentCenter),
160
- @"BOTTOM":@(ALButtonYAlignmentBottom),
161
- };
162
-
193
+ @"TOP": @(ALButtonYAlignmentTop),
194
+ @"CENTER": @(ALButtonYAlignmentCenter),
195
+ @"BOTTOM": @(ALButtonYAlignmentBottom),
196
+ };
163
197
  return [[map valueForKey:str.uppercaseString] integerValue];
164
198
  }
165
199
 
166
-
167
- +(ALButtonType) stringToButtonType:(NSString*) str {
200
+ + (ALButtonType)stringToButtonType:(NSString *)str {
168
201
  NSDictionary *map = @{
169
- @"FULLWIDTH":@(ALButtonTypeFullWidth),
170
- @"RECT":@(ALButtonTypeRect)
171
- };
172
-
202
+ @"FULLWIDTH": @(ALButtonTypeFullWidth),
203
+ @"RECT": @(ALButtonTypeRect)
204
+ };
173
205
  return [[map valueForKey:str.uppercaseString] integerValue];
174
206
  }
175
207
 
176
-
177
208
  + (UIColor *)colorFromHexString:(NSString *)hexString {
178
209
  unsigned rgbValue = 0;
179
210
  NSScanner *scanner = [NSScanner scannerWithString:hexString];
180
211
  // [scanner setScanLocation:1]; // bypass '#' character
181
212
  [scanner scanHexInt:&rgbValue];
182
- return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
213
+ return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0
214
+ green:((rgbValue & 0xFF00) >> 8)/255.0
215
+ blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
183
216
  }
184
217
 
185
218
 
219
+ + (NSString * _Nullable)barcodeFormatToNativeString:(NSString *)barcodeType {
220
+ static NSDictionary<NSString *, NSString *> * barcodeFormats = nil;
221
+ static dispatch_once_t onceToken;
222
+ dispatch_once(&onceToken, ^{
223
+ barcodeFormats = @{
224
+ kCodeTypeAztec: @"org.iso.Aztec",
225
+ kCodeTypeCode128: @"org.iso.Code128",
226
+ kCodeTypeCode39: @"org.iso.Code39",
227
+ kCodeTypeCode93: @"com.intermec.Code93",
228
+ kCodeTypeDataMatrix: @"org.iso.DataMatrix",
229
+ kCodeTypeEAN13: @"org.gs1.EAN-13",
230
+ kCodeTypeEAN8: @"org.gs1.EAN-8",
231
+ kCodeTypeMATRIX_2_5: @"org.ansi.Interleaved2of5",
232
+ kCodeTypeITF: @"org.gs1.ITF14",
233
+ kCodeTypePDF417: @"org.iso.PDF417",
234
+ kCodeTypeQR: @"org.iso.QRCode",
235
+ kCodeTypeUPCE: @"org.gs1.UPC-E",
236
+ kCodeTypeCodabar: @"Codabar",
237
+ kCodeTypeDATABAR: @"org.gs1.GS1DataBar",
238
+ kCodeTypeMICRO_QR: @"org.iso.MicroQR",
239
+ kCodeTypeMICRO_PDF: @"org.iso.MicroPDF417"
240
+ };
241
+ });
242
+ return barcodeFormats[barcodeType.uppercaseString];
243
+ }
244
+
186
245
  @end
246
+
@@ -1,27 +1,14 @@
1
- //
2
- // ALNFCScanViewController.h
3
- // AnylineExamples
4
- //
5
- // Created by Angela Brett on 08.10.19.
6
- //
7
-
8
1
  #import "ALPluginScanViewController.h"
9
- #import "ALJsonUIConfiguration.h"
2
+ #import "ALJSONUIConfiguration.h"
10
3
 
11
4
  NS_ASSUME_NONNULL_BEGIN
12
5
 
13
6
  @interface ALNFCScanViewController : UIViewController
14
7
 
15
- @property (nonatomic, assign) BOOL nativeBarcodeEnabled;
16
-
17
- @property (nonatomic, strong) NSString *cropAndTransformErrorMessage;
18
-
19
- @property (nonatomic, assign) NSUInteger quality;
20
-
21
8
  - (instancetype)initWithLicensekey:(NSString *)licensekey
22
9
  configuration:(NSDictionary *)anylineConfig
23
- uiConfig:(ALJsonUIConfiguration *)uiConfig
24
- delegate:(id<ALPluginScanViewControllerDelegate>)delegate;
10
+ uiConfig:(ALJSONUIConfiguration *)uiConfig
11
+ finished:(ALPluginCallback)callback;
25
12
  @end
26
13
 
27
14
  NS_ASSUME_NONNULL_END