Skip to content

Commit 99aeb22

Browse files
author
Jenkins
committed
5.7.1
1 parent ae8dafa commit 99aeb22

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react-native": "0.63.4",
1616
"react-native-check-box": "^2.1.7",
1717
"react-native-customized-image-picker": "^1.1.0",
18-
"@regulaforensics/react-native-document-reader-api": "^5.7.0",
18+
"@regulaforensics/react-native-document-reader-api": "^5.7.1",
1919
"@regulaforensics/react-native-document-reader-core-fullrfid": "^5.7.0",
2020
"react-native-progress": "^4.1.2",
2121
"react-native-fs": "^2.16.6",

ios/RNRegulaDocumentReader.m

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@import UIKit;
22
#import "RNRegulaDocumentReader.h"
33

4+
NSString* videoEncoderCompletionEvent = @"videoEncoderCompletionEvent";
5+
NSString* completionEvent = @"completionEvent";
6+
NSString* prepareDatabaseProgressChangeEvent = @"prepareDatabaseProgressChangeEvent";
47
NSString* rfidNotificationCompletionEvent = @"rfidNotificationCompletionEvent";
58
NSString* paCertificateCompletionEvent = @"paCertificateCompletionEvent";
69
NSString* taCertificateCompletionEvent = @"taCertificateCompletionEvent";
@@ -41,7 +44,15 @@ @implementation RNRegulaDocumentReader
4144
RCT_EXPORT_MODULE();
4245

4346
- (NSArray<NSString*>*)supportedEvents {
44-
return @[@"prepareDatabaseProgressChangeEvent", @"completionEvent", @"videoEncoderCompletionEvent"];
47+
return @[
48+
prepareDatabaseProgressChangeEvent,
49+
completionEvent,
50+
videoEncoderCompletionEvent,
51+
rfidNotificationCompletionEvent,
52+
paCertificateCompletionEvent,
53+
taCertificateCompletionEvent,
54+
taSignatureCompletionEvent
55+
];
4556
}
4657

4758
static NSNumber* _databasePercentageDownloaded;
@@ -58,36 +69,36 @@ - (void)result:(NSString*)message :(Callback)callback {
5869
-(void (^_Nullable)(NSProgress * _Nonnull progress))getProgressHandler:(Callback)successCallback :(Callback)errorCallback{
5970
return ^(NSProgress * _Nonnull progress) {
6071
if(RNRegulaDocumentReader.databasePercentageDownloaded != [NSNumber numberWithDouble:progress.fractionCompleted * 100]){
61-
[self sendEventWithName:@"prepareDatabaseProgressChangeEvent" body:@{@"msg": [NSString stringWithFormat:@"%.1f", progress.fractionCompleted * 100]}];
72+
[self sendEventWithName:prepareDatabaseProgressChangeEvent body:@{@"msg": [NSString stringWithFormat:@"%.1f", progress.fractionCompleted * 100]}];
6273
[RNRegulaDocumentReader setDatabasePercentageDownloaded:[NSNumber numberWithDouble:progress.fractionCompleted * 100]];
6374
}
6475
};
6576
}
6677

6778
-(RGLDocumentReaderCompletion _Nonnull)getCompletion {
6879
return ^(RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error) {
69-
[self sendEventWithName:@"completionEvent" body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateDocReaderAction: action] :results :error :nil]]}];
80+
[self sendEventWithName:completionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateDocReaderAction: action] :results :error :nil]]}];
7081
};
7182
}
7283

7384
-(RGLRFIDProcessCompletion _Nonnull)getRFIDCompletion {
7485
return ^(RGLRFIDCompleteAction action, RGLDocumentReaderResults * _Nullable results, NSError * _Nullable error, RGLRFIDErrorCodes errorCode) {
75-
[self sendEventWithName:@"completionEvent" body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDCompleteAction: action] :results :error :nil]]}];
86+
[self sendEventWithName:completionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDCompleteAction: action] :results :error :nil]]}];
7687
};
7788
}
7889

7990
-(RGLRFIDNotificationCallback _Nonnull)getRFIDNotificationCallback {
8091
return ^(RGLRFIDNotificationAction notificationAction, RGLRFIDNotify* _Nullable notify) {
81-
[self sendEventWithName:@"completionEvent" body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDNotificationAction:notificationAction] :nil :nil :notify]]}];
92+
[self sendEventWithName:completionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateCompletion:[RGLWJSONConstructor generateRFIDNotificationAction:notificationAction] :nil :nil :notify]]}];
8293
};
8394
}
8495

8596
- (void)didFinishRecordingToFile:(NSURL *)fileURL {
86-
[self sendEventWithName:@"videoEncoderCompletionEvent" body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateVideoEncoderCompletion:fileURL :nil]]}];
97+
[self sendEventWithName:videoEncoderCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateVideoEncoderCompletion:fileURL :nil]]}];
8798
}
8899

89100
- (void)didFailWithError:(NSError *)error {
90-
[self sendEventWithName:@"videoEncoderCompletionEvent" body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateVideoEncoderCompletion:nil :error]]}];
101+
[self sendEventWithName:videoEncoderCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateVideoEncoderCompletion:nil :error]]}];
91102
}
92103

93104
- (void)onRequestPACertificatesWithSerial:(NSData *)serialNumber issuer:(RGLPAResourcesIssuer *)issuer callback:(RGLRFIDCertificatesCallback)callback {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@regulaforensics/react-native-document-reader-api",
3-
"version": "5.7.0",
3+
"version": "5.7.1",
44
"description": "React Native module for reading and validation of identification documents (API framework)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)