facia-mobilesdk 0.0.8 → 0.1.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.
|
@@ -43,13 +43,13 @@ public class FaciaReactNativeModule extends ReactContextBaseJavaModule {
|
|
|
43
43
|
|
|
44
44
|
if (docType.equalsIgnoreCase("ID_CARD"))
|
|
45
45
|
{
|
|
46
|
-
configJson.put("documentType", DocumentType.ID_CARD)
|
|
46
|
+
configJson.put("documentType", DocumentType.ID_CARD);
|
|
47
47
|
}else if (docType.equalsIgnoreCase("PASSPORT"))
|
|
48
48
|
{
|
|
49
|
-
configJson.put("documentType", DocumentType.PASSPORT)
|
|
49
|
+
configJson.put("documentType", DocumentType.PASSPORT);
|
|
50
50
|
}else
|
|
51
51
|
{
|
|
52
|
-
configJson.put("documentType", DocumentType.OTHERS)
|
|
52
|
+
configJson.put("documentType", DocumentType.OTHERS);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
FaciaAi faciaAi = new FaciaAi();
|
package/ios/MobilesdkModule.m
CHANGED
|
@@ -1,45 +1,43 @@
|
|
|
1
1
|
#import "MobilesdkModule.h"
|
|
2
|
-
#import <
|
|
2
|
+
#import <Facia/Facia-Swift.h>
|
|
3
3
|
#import <React/RCTLog.h>
|
|
4
4
|
#import <React/RCTUtils.h>
|
|
5
5
|
|
|
6
6
|
@implementation MobilesdkModule
|
|
7
7
|
|
|
8
|
-
RCT_EXPORT_MODULE(
|
|
8
|
+
RCT_EXPORT_MODULE(FaciaReactNativeModule)
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
RCT_EXPORT_METHOD(testMethod:(NSString *)name location:(NSString *)location)
|
|
12
12
|
{
|
|
13
|
-
|
|
14
|
-
RCTLogInfo(@"Pretending to create an event %@ at %@", [
|
|
13
|
+
Facia *facia = [[Facia alloc] init];
|
|
14
|
+
RCTLogInfo(@"Pretending to create an event %@ at %@", [facia getUniqueReference] , location);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
// RCT_EXPORT_METHOD(verify:(NSString *)request auth:(NSString *)auth config:(NSString *)config callback: (RCTResponseSenderBlock) callback)
|
|
19
|
+
RCT_EXPORT_METHOD(verifyWithPrefix:(NSString *)documentType config:(NSString *)config callback: (RCTResponseSenderBlock) callback)
|
|
18
20
|
{
|
|
19
|
-
|
|
21
|
+
|
|
22
|
+
Facia *facia = [[Facia alloc] init];
|
|
20
23
|
|
|
21
|
-
// UIViewController *rootController =
|
|
22
|
-
// [UIApplication sharedApplication]delegate] window] rootViewController];
|
|
23
24
|
UIViewController* vc = RCTPresentedViewController();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
|
|
27
|
+
[facia createRequestWithParentViewController:vc
|
|
28
|
+
configs:[self parseJSONString:config]
|
|
29
|
+
completion:^(NSDictionary *result) {
|
|
30
|
+
NSString *response = [self convertToJSONString:result];
|
|
31
|
+
callback(@[response]);
|
|
32
|
+
}];
|
|
33
|
+
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
NSLog(@"
|
|
35
|
-
|
|
36
|
-
NSLog(@"pasrsing string to json auth %@", [self parseJSONString:auth]);
|
|
37
|
-
[shufti shuftiProVerificationWithRequestObject:[self parseJSONString:request] authKeys:[self parseJSONString:auth] parentVC:vc configs:[self parseJSONString:config] completion:^(NSDictionary *result) {
|
|
38
|
-
NSLog(@"Verification completed. Result: %@", result);
|
|
39
|
-
NSString *response = [self convertToJSONString:result];
|
|
35
|
+
// [shufti shuftiProVerificationWithRequestObject:[self parseJSONString:request] authKeys:[self parseJSONString:auth] parentVC:vc configs:[self parseJSONString:config] completion:^(NSDictionary *result) {
|
|
36
|
+
// NSLog(@"Verification completed. Result: %@", result);
|
|
37
|
+
// NSString *response = [self convertToJSONString:result];
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
}];
|
|
39
|
+
// callback(@[response]);
|
|
40
|
+
// }];
|
|
43
41
|
|
|
44
42
|
|
|
45
43
|
}
|
|
@@ -88,8 +86,8 @@ return [[UIDevice currentDevice] name];
|
|
|
88
86
|
|
|
89
87
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getUniqueReference)
|
|
90
88
|
{
|
|
91
|
-
|
|
92
|
-
return [
|
|
89
|
+
Facia *facia = [[Facia alloc] init];
|
|
90
|
+
return [facia getUniqueReference];
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
- (NSArray<NSString *> *)supportedEvents {
|