@regulaforensics/react-native-document-reader-api 9.11.948-rc → 9.11.950-rc

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.
@@ -0,0 +1,8 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
3
+ #import <React/RCTUtils.h>
4
+ #import "RGLWMain.h"
5
+ @import UIKit;
6
+
7
+ @interface RNRegulaDocumentReader : RCTEventEmitter <RCTBridgeModule>
8
+ @end
@@ -1,12 +1,48 @@
1
- #import <React/RCTEventEmitter.h>
2
- #import <React/RCTBridgeModule.h>
1
+ #import "RNRegulaDocumentReader.h"
3
2
 
4
- @interface RCT_EXTERN_MODULE(RNRegulaDocumentReader, RCTEventEmitter)
3
+ RNRegulaDocumentReader* RGLWPlugin;
5
4
 
6
- RCT_EXTERN_METHOD(exec:(NSString*)module
7
- action:(NSString*)action
8
- newArgs:(NSArray*)newArgs
9
- success:(RCTResponseSenderBlock)success
10
- error:(RCTResponseSenderBlock)error)
5
+ @implementation RNRegulaDocumentReader
6
+ @synthesize bridge = _bridge;
7
+ RCT_EXPORT_MODULE();
8
+
9
+ - (NSArray<NSString*>*)supportedEvents {
10
+ return @[completionEvent,
11
+ databaseProgressEvent,
12
+ rfidOnProgressEvent,
13
+ rfidOnChipDetectedEvent,
14
+ rfidOnRetryReadChipEvent,
15
+ paCertificateCompletionEvent,
16
+ taCertificateCompletionEvent,
17
+ taSignatureCompletionEvent,
18
+ aaChallengeCompletionEvent,
19
+ paceProtocolCompletionEvent,
20
+ caProtocolCompletionEvent,
21
+ drVideoEncoderCompletionEvent,
22
+ drOnCustomButtonTappedEvent];
23
+ }
24
+
25
+ static bool hasListeners;
26
+ -(void)startObserving { hasListeners = YES; }
27
+ -(void)stopObserving { hasListeners = NO; }
28
+
29
+ UIViewController*(^RGLWRootViewController)(void) = ^UIViewController*(){
30
+ return RCTPresentedViewController();
31
+ };
32
+
33
+ static RGLWEventSender sendEvent = ^(NSString* event, id data) {
34
+ dispatch_async(dispatch_get_main_queue(), ^{
35
+ if (hasListeners) [RGLWPlugin sendEventWithName:event body:@{@"msg": data}];
36
+ });
37
+ };
38
+
39
+ RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(RCTResponseSenderBlock)sCallback:(RCTResponseSenderBlock)eCallback) {
40
+ RGLWPlugin = self;
41
+ RGLWCallback callback = ^(id _Nullable data) {
42
+ if (data == nil) sCallback(@[[NSNull null]]);
43
+ else sCallback(@[data]);
44
+ };
45
+ [RGLWMain methodCall:action :args :callback :sendEvent];
46
+ }
11
47
 
12
48
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/react-native-document-reader-api",
3
- "version": "9.11.948-rc",
3
+ "version": "9.11.950-rc",
4
4
  "description": "React Native module for reading and validation of identification documents (API framework)",
5
5
  "main": "index.js",
6
6
  "scripts": {