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();
@@ -1,45 +1,43 @@
1
1
  #import "MobilesdkModule.h"
2
- #import <ShuftiPro/ShuftiPro-Swift.h>
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(ShuftiproReactNativeModule)
8
+ RCT_EXPORT_MODULE(FaciaReactNativeModule)
9
9
 
10
10
 
11
11
  RCT_EXPORT_METHOD(testMethod:(NSString *)name location:(NSString *)location)
12
12
  {
13
- ShuftiPro *shufti = [[ShuftiPro alloc] init];
14
- RCTLogInfo(@"Pretending to create an event %@ at %@", [shufti getUniqueReference] , location);
13
+ Facia *facia = [[Facia alloc] init];
14
+ RCTLogInfo(@"Pretending to create an event %@ at %@", [facia getUniqueReference] , location);
15
15
  }
16
16
 
17
- RCT_EXPORT_METHOD(verify:(NSString *)request auth:(NSString *)auth config:(NSString *)config callback: (RCTResponseSenderBlock) callback)
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
- ShuftiPro *shufti = [[ShuftiPro alloc] init];
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
- // [shufti shuftiProVerificationWithRequestObject:requestObject authKeys:authKeys parentVC:vc configs:configs completion:^(NSDictionary *result) {
29
- // NSLog(@"Verification succeeded. Result: %@", result);
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
- NSLog(@"Call from OBjective C ");
34
- NSLog(@"pasrsing string to json config %@", [self parseJSONString:config]);
35
- NSLog(@"pasrsing string to json request %@", [self parseJSONString:request]);
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
- callback(@[response]);
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
- ShuftiPro *shufti = [[ShuftiPro alloc] init];
92
- return [shufti getUniqueReference];
89
+ Facia *facia = [[Facia alloc] init];
90
+ return [facia getUniqueReference];
93
91
  }
94
92
 
95
93
  - (NSArray<NSString *> *)supportedEvents {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "facia-mobilesdk",
3
3
  "title": "React Native Mobilesdk Module",
4
- "version": "0.0.8",
4
+ "version": "0.1.0",
5
5
  "description": "Facia mobile SDK",
6
6
  "main": "index.js",
7
7
  "files": [