react-native-kalapa-ekyc 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.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  7. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.9/gc.properties +0 -0
  10. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  12. package/android/.gradle/vcs-1/gc.properties +0 -0
  13. package/android/build.gradle +63 -0
  14. package/android/src/main/AndroidManifest.xml +4 -0
  15. package/android/src/main/java/com/reactnativekalapaekyc/KalapaEkycModule.java +107 -0
  16. package/android/src/main/java/com/reactnativekalapaekyc/KalapaEkycPackage.java +28 -0
  17. package/android/src/main/java/com/reactnativekalapaekyc/kUtils.java +66 -0
  18. package/ios/KalapaEkyc.h +5 -0
  19. package/ios/KalapaEkyc.m +154 -0
  20. package/ios/KalapaEkyc.xcodeproj/project.pbxproj +167 -0
  21. package/ios/KalapaEkyc.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  22. package/ios/KalapaEkyc.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  23. package/ios/KalapaEkyc.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  24. package/lib/commonjs/index.js +12 -0
  25. package/lib/commonjs/index.js.map +1 -0
  26. package/lib/module/index.js +6 -0
  27. package/lib/module/index.js.map +1 -0
  28. package/lib/typescript/index.d.ts +2 -0
  29. package/package.json +157 -0
  30. package/react-native-kalapa-ekyc.podspec +21 -0
  31. package/src/index.tsx +8 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Dat Hoang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # react-native-kalapa-ekyc
2
+
3
+ KALAPA .JSV React-Native eKYC
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-kalapa-ekyc
9
+ ```
10
+
11
+ ```sh
12
+ yarn add react-native-kalapa-ekyc
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ import { multiply } from "react-native-kalapa-ekyc";
19
+ // ...
20
+
21
+ const result = await multiply(3, 7);
22
+ ```
23
+
24
+ ## Contributing
25
+
26
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
27
+
28
+ ## License
29
+
30
+ MIT
File without changes
@@ -0,0 +1,2 @@
1
+ #Sat Aug 24 14:59:05 ICT 2024
2
+ gradle.version=8.9
File without changes
@@ -0,0 +1,63 @@
1
+ buildscript {
2
+ if (project == rootProject) {
3
+ repositories {
4
+ google()
5
+ mavenCentral()
6
+ jcenter()
7
+ // maven { uri 'https://www.jitpack.io'}
8
+ }
9
+
10
+ dependencies {
11
+ classpath 'com.android.tools.build:gradle:3.5.3'
12
+ }
13
+ }
14
+ }
15
+
16
+ apply plugin: 'com.android.library'
17
+
18
+ def safeExtGet(prop, fallback) {
19
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20
+ }
21
+
22
+ android {
23
+ compileSdkVersion safeExtGet('KalapaEkyc_compileSdkVersion', 34)
24
+ defaultConfig {
25
+ minSdkVersion safeExtGet('KalapaEkyc_minSdkVersion', 26)
26
+ targetSdkVersion safeExtGet('KalapaEkyc_targetSdkVersion', 34)
27
+ versionCode 1
28
+ versionName "1.8"
29
+
30
+ }
31
+
32
+ buildTypes {
33
+ release {
34
+ minifyEnabled false
35
+ }
36
+ }
37
+ lintOptions {
38
+ disable 'GradleCompatible'
39
+ }
40
+ compileOptions {
41
+ sourceCompatibility JavaVersion.VERSION_1_8
42
+ targetCompatibility JavaVersion.VERSION_1_8
43
+ }
44
+ }
45
+
46
+ repositories {
47
+ mavenLocal()
48
+ maven {
49
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
50
+ url("$rootDir/../node_modules/react-native/android")
51
+ }
52
+ google()
53
+ mavenCentral()
54
+ jcenter()
55
+ // maven { uri 'https://www.jitpack.io'}
56
+ }
57
+
58
+ dependencies {
59
+ //noinspection GradleDynamicVersion
60
+ implementation "com.facebook.react:react-native:+" // From node_modules
61
+ implementation 'com.google.android.gms:play-services-ads-identifier:15.0.0'
62
+ implementation 'vn.kalapa:ekyc:2.10.3.8'
63
+ }
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnativekalapaekyc">
3
+
4
+ </manifest>
@@ -0,0 +1,107 @@
1
+ package com.reactnativekalapaekyc;
2
+
3
+ import android.content.Context;
4
+ import android.widget.Toast;
5
+
6
+ import androidx.annotation.NonNull;
7
+
8
+ import com.facebook.react.bridge.Promise;
9
+ import com.facebook.react.bridge.ReactApplicationContext;
10
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
11
+ import com.facebook.react.bridge.ReactMethod;
12
+ import com.facebook.react.module.annotations.ReactModule;
13
+ import com.facebook.react.bridge.Callback;
14
+ import com.facebook.react.bridge.ReadableMap;
15
+ import com.facebook.react.bridge.WritableMap;
16
+ import com.facebook.react.bridge.WritableNativeMap;
17
+
18
+ import java.util.Objects;
19
+
20
+ import vn.kalapa.ekyc.KalapaHandler;
21
+ import vn.kalapa.ekyc.KalapaSDK;
22
+ import vn.kalapa.ekyc.KalapaSDKConfig;
23
+ import vn.kalapa.ekyc.models.KalapaResult;
24
+
25
+ @ReactModule(name = KalapaEkycModule.NAME)
26
+ public class KalapaEkycModule extends ReactContextBaseJavaModule {
27
+ public static final String NAME = "KalapaEkyc";
28
+
29
+ public KalapaEkycModule(ReactApplicationContext reactContext) {
30
+ super(reactContext);
31
+ }
32
+
33
+ @Override
34
+ @NonNull
35
+ public String getName() {
36
+ return NAME;
37
+ }
38
+
39
+
40
+ // Example method
41
+ // See https://reactnative.dev/docs/native-modules-android
42
+ @ReactMethod
43
+ public void multiply(int a, int b, Promise promise) {
44
+ promise.resolve(a * b);
45
+ }
46
+
47
+ @ReactMethod
48
+ public void start(String session, String flow, ReadableMap data, final Callback callback) {
49
+
50
+ String domain = data.getString("domain");
51
+ String mainColor = data.getString("main_color") != null ? data.getString("main_color") : "#1F69E6";
52
+ String background = data.getString("background_color") != null ? data.getString("background_color") : "#FFFFFF";
53
+ String mainTextColor = data.getString("main_text_color") != null ? data.getString("main_text_color") : "#000000";
54
+ String btnTextColor = data.getString("btn_text_color") != null ? data.getString("btn_text_color") : "#FFFFFF";
55
+ String language = data.getString("language") != null ? data.getString("language") : "en";
56
+ int livenessVersion = data.getInt("liveness_version");
57
+
58
+ String faceData = data.getString("face_data") != null ? data.getString("face_data") : "";
59
+ String mrzData = data.getString("mrz") != null ? data.getString("mrz") : "";
60
+ String sessionId = data.getString("session_id") != null ? data.getString("session_id") : "";
61
+
62
+ Context context = getReactApplicationContext();
63
+ KalapaSDKConfig klpConfig = new KalapaSDKConfig.KalapaSDKConfigBuilder(context)
64
+ .withBaseURL(domain)
65
+ .withMainColor(mainColor)
66
+ .withBackgroundColor(background)
67
+ .withMainTextColor(mainTextColor)
68
+ .withBtnTextColor(btnTextColor)
69
+ .withLanguage(language)
70
+ .withLivenessVersion(livenessVersion).build();
71
+
72
+ if (getCurrentActivity() != null) {
73
+ // KalapaSDK.Companion.startFullEKYC(Objects.requireNonNull(getCurrentActivity()), session, flow, klpConfig, sessionId != null ? session : "", mrzData != null ? mrzData : "", faceData != null ? faceData : "", new KalapaHandler() {
74
+ // @Override
75
+ // public void onComplete(@NonNull KalapaResult kalapaResult) {
76
+ // super.onComplete(kalapaResult);
77
+ // String resultMap = kalapaResult.toJson();
78
+ // WritableMap res = new WritableNativeMap();
79
+ // res.putString("kalapa_result", resultMap);
80
+ // callback.invoke(res);
81
+ // }
82
+ // });
83
+ KalapaSDK.KalapaSDKBuilder builder = new KalapaSDK.KalapaSDKBuilder(getCurrentActivity(), klpConfig);
84
+ if (faceData != null && !faceData.isEmpty()) builder.withFaceData(faceData);
85
+ if (mrzData != null && !mrzData.isEmpty()) builder.withMrz(mrzData);
86
+ if (sessionId != null && !sessionId.isEmpty()) builder.withLeftoverSession(sessionId);
87
+
88
+ builder.build().start(session, flow, new KalapaHandler() {
89
+ @Override
90
+ public void onExpired() {
91
+
92
+ }
93
+
94
+ @Override
95
+ public void onComplete(@NonNull KalapaResult kalapaResult) {
96
+ super.onComplete(kalapaResult);
97
+ String resultMap = kalapaResult.toJson();
98
+ WritableMap res = new WritableNativeMap();
99
+ res.putString("kalapa_result", resultMap);
100
+ callback.invoke(res);
101
+ }
102
+ });
103
+ } else Toast.makeText(getReactApplicationContext(), "Activity is null", Toast.LENGTH_LONG).show();
104
+ }
105
+
106
+ public static native int nativeMultiply(int a, int b);
107
+ }
@@ -0,0 +1,28 @@
1
+ package com.reactnativekalapaekyc;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.ArrayList;
11
+ import java.util.Collections;
12
+ import java.util.List;
13
+
14
+ public class KalapaEkycPackage implements ReactPackage {
15
+ @NonNull
16
+ @Override
17
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
+ List<NativeModule> modules = new ArrayList<>();
19
+ modules.add(new KalapaEkycModule(reactContext));
20
+ return modules;
21
+ }
22
+
23
+ @NonNull
24
+ @Override
25
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
@@ -0,0 +1,66 @@
1
+ package com.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.WritableArray;
4
+ import com.facebook.react.bridge.WritableMap;
5
+ import com.facebook.react.bridge.WritableNativeArray;
6
+ import com.facebook.react.bridge.WritableNativeMap;
7
+
8
+ import org.json.JSONArray;
9
+
10
+ import java.util.List;
11
+ import java.util.Map;
12
+
13
+ class kUtils {
14
+ public static WritableMap convertMapToWritableMap(Map<String, Object> input) {
15
+ WritableMap output = new WritableNativeMap();
16
+
17
+ for (Map.Entry<String, Object> entry : input.entrySet()) {
18
+ String key = entry.getKey();
19
+ Object value = entry.getValue();
20
+ if (value instanceof Map) {
21
+ output.putMap(key, convertMapToWritableMap((Map<String, Object>) value));
22
+ } else if (value instanceof JSONArray) {
23
+ output.putArray(key, convertArrayToWritableArray((Object[]) value));
24
+ } else if (value instanceof List) {
25
+ output.putArray(key, convertArrayToWritableArray(((List) value).toArray()));
26
+ } else if (value instanceof Boolean) {
27
+ output.putBoolean(key, (Boolean) value);
28
+ } else if (value instanceof Integer) {
29
+ output.putInt(key, (Integer) value);
30
+ } else if (value instanceof Double) {
31
+ output.putDouble(key, (Double) value);
32
+ } else if (value instanceof String) {
33
+ output.putString(key, (String) value);
34
+ } else {
35
+ output.putString(key, value.toString());
36
+ }
37
+ }
38
+ return output;
39
+ }
40
+
41
+ public static WritableArray convertArrayToWritableArray(Object[] input) {
42
+ WritableArray output = new WritableNativeArray();
43
+
44
+ for (int i = 0; i < input.length; i++) {
45
+ Object value = input[i];
46
+ if (value instanceof Map) {
47
+ output.pushMap(convertMapToWritableMap((Map<String, Object>) value));
48
+ } else if (value instanceof JSONArray) {
49
+ output.pushArray(convertArrayToWritableArray((Object[]) value));
50
+ } else if (value instanceof List) {
51
+ output.pushArray(convertArrayToWritableArray(((List) value).toArray()));
52
+ } else if (value instanceof Boolean) {
53
+ output.pushBoolean((Boolean) value);
54
+ } else if (value instanceof Integer) {
55
+ output.pushInt((Integer) value);
56
+ } else if (value instanceof Double) {
57
+ output.pushDouble((Double) value);
58
+ } else if (value instanceof String) {
59
+ output.pushString((String) value);
60
+ } else {
61
+ output.pushString(value.toString());
62
+ }
63
+ }
64
+ return output;
65
+ }
66
+ }
@@ -0,0 +1,5 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface KalapaEkyc : NSObject <RCTBridgeModule>
4
+
5
+ @end
@@ -0,0 +1,154 @@
1
+ #import "KalapaEkyc.h"
2
+ #import <UIKit/UIKit.h>
3
+ #import <KalapaSDK/KalapaSDK.h>
4
+
5
+ @implementation KalapaEkyc
6
+
7
+ RCT_EXPORT_MODULE()
8
+
9
+
10
+
11
+ // Example method
12
+ // See // https://reactnative.dev/docs/native-modules-ios
13
+ RCT_REMAP_METHOD(multiply,
14
+ multiplyWithA:(nonnull NSNumber*)a withB:(nonnull NSNumber*)b
15
+ withResolver:(RCTPromiseResolveBlock)resolve
16
+ withRejecter:(RCTPromiseRejectBlock)reject)
17
+ {
18
+ NSNumber *result = @([a floatValue] * [b floatValue]);
19
+
20
+ resolve(result);
21
+ }
22
+
23
+
24
+ RCT_EXPORT_METHOD(start: (NSString *)session
25
+ flow: (NSString *)flow
26
+ data: (NSDictionary*)data
27
+ listener:(RCTResponseSenderBlock)callback)
28
+ {
29
+ dispatch_async(dispatch_get_main_queue(), ^{
30
+ if (@available(iOS 13, *)) {
31
+ NSString *domain = data[@"domain"] ?: @"https://ekyc-api.kalapa.vn";
32
+ NSString *language = data[@"language"] ?: @"vi";
33
+
34
+ NSString *mainColor = data[@"main_color"] ?: @"3270EA";
35
+ NSString *backgroundColor = data[@"background_color"] ?: @"ffffff";
36
+ NSString *mainTextColor = data[@"main_text_color"] ?: @"000000";
37
+ NSString *btnTextColor = data[@"btn_text_color"] ?: @"ffffff";
38
+ NSInteger livenessVersion = [data[@"liveness_version"] integerValue] ?: 0;
39
+
40
+ NSString *faceData = data[@"face_data"];
41
+ NSString *mrz = data[@"mrz"];
42
+ NSString *sessionID = data[@"session_id"];
43
+
44
+ KLPAppearance *klpAppearance = [[[[[[KLPAppearance Builder]
45
+ withLanguage:language]
46
+ withMainColor:mainColor]
47
+ withBackgroundColor:backgroundColor]
48
+ withMainTextColor:mainTextColor]
49
+ withBtnTextColor:btnTextColor];
50
+
51
+ KLPConfig *klpConfig = [self configureKLPWithSession:session
52
+ domain:domain
53
+ livenessVersion:livenessVersion
54
+ appearance:klpAppearance
55
+ mrz:mrz
56
+ faceData:faceData];
57
+
58
+ if (sessionID != nil) {
59
+ [klpConfig withSession:sessionID];
60
+ }
61
+
62
+ [klpConfig withResultHandler:^(KalapaResult * _Nullable result) {
63
+ if (callback) {
64
+ NSDictionary *jsonResult = [self handleResult:result];
65
+ callback(@[jsonResult]);
66
+ }
67
+ }];
68
+
69
+ [klpConfig buildWithCompletionHandler:^(KLPConfig * _Nullable config, NSError * _Nullable error) {
70
+ dispatch_async(dispatch_get_main_queue(), ^{
71
+ if (error == nil) {
72
+ [[Kalapa shared] runWithFlow:flow withConfig:config];
73
+ } else {
74
+ [self showAlert:error.localizedDescription];
75
+ }
76
+ });
77
+ }];
78
+
79
+ } else {
80
+ [self showAlert:@"Kalapa doesn't support iOS less than 11"];
81
+ }
82
+ });
83
+ }
84
+
85
+ #pragma mark - Helper Methods
86
+
87
+ - (KLPConfig *)configureKLPWithSession:(NSString *)session
88
+ domain:(NSString *)domain
89
+ livenessVersion:(NSInteger)livenessVersion
90
+ appearance:(KLPAppearance *)appearance
91
+ mrz:(NSString *)mrz
92
+ faceData:(NSString *)faceData {
93
+ KLPConfig *config = [[[[[[KLPConfig BuilderWithSession:session]
94
+ withBaseUrl:domain]
95
+ withLivenessVersion:livenessVersion]
96
+ withAppearance:appearance]
97
+ withMRZ:mrz]
98
+ withFaceDataBase64:faceData];
99
+ return config;
100
+ }
101
+
102
+ - (NSDictionary *)handleResult:(KalapaResult *)result {
103
+ NSDictionary<NSString *, id> *resultJson = [result toDictionary];
104
+ NSDictionary<NSString *, id> *rawJson = [result rawJson];
105
+ NSDictionary *fields = rawJson[@"ocr_data"][@"data"][@"fields"];
106
+
107
+ NSMutableDictionary *json = [NSMutableDictionary dictionaryWithDictionary:fields];
108
+ json[@"session"] = rawJson[@"session"] ?: @"";
109
+ json[@"decision"] = resultJson[@"decision"] ?: @"";
110
+ json[@"nfc_data"] = rawJson[@"nfc_data"];
111
+
112
+ NSDictionary *selfieData = rawJson[@"selfie_data"][@"data"];
113
+ if (selfieData) {
114
+ json[@"selfie_data"] = @{
115
+ @"is_matched": selfieData[@"is_matched"],
116
+ @"matching_score": selfieData[@"matching_score"]
117
+ };
118
+ }
119
+
120
+ json[@"mrz_data"] = rawJson[@"ocr_data"][@"data"][@"mrz_data"];
121
+
122
+ NSDictionary *qrCodeData = rawJson[@"ocr_data"][@"data"][@"qr_code"];
123
+ if (qrCodeData && qrCodeData[@"data"]) {
124
+ json[@"qr_code"] = @{@"decoded_text": qrCodeData[@"data"][@"decoded_text"] ?: @""};
125
+ }
126
+
127
+ if (resultJson[@"decision_detail"]) {
128
+ json[@"decision_detail"] = resultJson[@"decision_detail"];
129
+ }
130
+ json[@"resident_entities"] = fields[@"resident_entities"];
131
+ json[@"home_entities"] = fields[@"home_entities"];
132
+
133
+ NSError *error;
134
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:json options:NSJSONWritingPrettyPrinted error:&error];
135
+ NSString *jsonString = jsonData ? [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] : @"";
136
+
137
+ return @{@"kalapa_result": jsonString};
138
+ }
139
+
140
+
141
+ - (void)showAlert:(NSString*)message {
142
+ UIViewController *root = [UIApplication sharedApplication].delegate.window.rootViewController;
143
+ if (root) {
144
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"KLP" message:message preferredStyle:UIAlertControllerStyleAlert];
145
+ [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
146
+
147
+ [root presentViewController:alert animated:YES completion:nil];
148
+ }
149
+ }
150
+
151
+
152
+ @end
153
+
154
+
@@ -0,0 +1,167 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXFileReference section */
10
+ B3E7B5881CC2AC0600A0062D /* KalapaEkyc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KalapaEkyc.h; sourceTree = "<group>"; };
11
+ B3E7B5891CC2AC0600A0062D /* KalapaEkyc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KalapaEkyc.m; sourceTree = "<group>"; };
12
+ /* End PBXFileReference section */
13
+
14
+ /* Begin PBXGroup section */
15
+ 134814211AA4EA7D00B7C361 /* Products */ = {
16
+ isa = PBXGroup;
17
+ children = (
18
+ );
19
+ name = Products;
20
+ sourceTree = "<group>";
21
+ };
22
+ 58B511D21A9E6C8500147676 = {
23
+ isa = PBXGroup;
24
+ children = (
25
+ B3E7B5881CC2AC0600A0062D /* KalapaEkyc.h */,
26
+ B3E7B5891CC2AC0600A0062D /* KalapaEkyc.m */,
27
+ 134814211AA4EA7D00B7C361 /* Products */,
28
+ );
29
+ sourceTree = "<group>";
30
+ };
31
+ /* End PBXGroup section */
32
+
33
+ /* Begin PBXProject section */
34
+ 58B511D31A9E6C8500147676 /* Project object */ = {
35
+ isa = PBXProject;
36
+ attributes = {
37
+ LastUpgradeCheck = 0920;
38
+ ORGANIZATIONNAME = Facebook;
39
+ };
40
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "KalapaEkyc" */;
41
+ compatibilityVersion = "Xcode 3.2";
42
+ developmentRegion = vi;
43
+ hasScannedForEncodings = 0;
44
+ knownRegions = (
45
+ English,
46
+ en,
47
+ vi,
48
+ );
49
+ mainGroup = 58B511D21A9E6C8500147676;
50
+ productRefGroup = 58B511D21A9E6C8500147676;
51
+ projectDirPath = "";
52
+ projectRoot = "";
53
+ targets = (
54
+ );
55
+ };
56
+ /* End PBXProject section */
57
+
58
+ /* Begin XCBuildConfiguration section */
59
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
60
+ isa = XCBuildConfiguration;
61
+ buildSettings = {
62
+ ALWAYS_SEARCH_USER_PATHS = NO;
63
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
64
+ CLANG_CXX_LIBRARY = "libc++";
65
+ CLANG_ENABLE_MODULES = YES;
66
+ CLANG_ENABLE_OBJC_ARC = YES;
67
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
68
+ CLANG_WARN_BOOL_CONVERSION = YES;
69
+ CLANG_WARN_COMMA = YES;
70
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
71
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
72
+ CLANG_WARN_EMPTY_BODY = YES;
73
+ CLANG_WARN_ENUM_CONVERSION = YES;
74
+ CLANG_WARN_INFINITE_RECURSION = YES;
75
+ CLANG_WARN_INT_CONVERSION = YES;
76
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
77
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
78
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
79
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
80
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
81
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
82
+ CLANG_WARN_UNREACHABLE_CODE = YES;
83
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
84
+ COPY_PHASE_STRIP = NO;
85
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
86
+ ENABLE_TESTABILITY = YES;
87
+ GCC_C_LANGUAGE_STANDARD = gnu99;
88
+ GCC_DYNAMIC_NO_PIC = NO;
89
+ GCC_NO_COMMON_BLOCKS = YES;
90
+ GCC_OPTIMIZATION_LEVEL = 0;
91
+ GCC_PREPROCESSOR_DEFINITIONS = (
92
+ "DEBUG=1",
93
+ "$(inherited)",
94
+ );
95
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
96
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
97
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
98
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
99
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
100
+ GCC_WARN_UNUSED_FUNCTION = YES;
101
+ GCC_WARN_UNUSED_VARIABLE = YES;
102
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
103
+ MTL_ENABLE_DEBUG_INFO = YES;
104
+ ONLY_ACTIVE_ARCH = YES;
105
+ SDKROOT = iphoneos;
106
+ };
107
+ name = Debug;
108
+ };
109
+ 58B511EE1A9E6C8500147676 /* Release */ = {
110
+ isa = XCBuildConfiguration;
111
+ buildSettings = {
112
+ ALWAYS_SEARCH_USER_PATHS = NO;
113
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
114
+ CLANG_CXX_LIBRARY = "libc++";
115
+ CLANG_ENABLE_MODULES = YES;
116
+ CLANG_ENABLE_OBJC_ARC = YES;
117
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
118
+ CLANG_WARN_BOOL_CONVERSION = YES;
119
+ CLANG_WARN_COMMA = YES;
120
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
121
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
122
+ CLANG_WARN_EMPTY_BODY = YES;
123
+ CLANG_WARN_ENUM_CONVERSION = YES;
124
+ CLANG_WARN_INFINITE_RECURSION = YES;
125
+ CLANG_WARN_INT_CONVERSION = YES;
126
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
127
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
128
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
129
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
130
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
131
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
132
+ CLANG_WARN_UNREACHABLE_CODE = YES;
133
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
134
+ COPY_PHASE_STRIP = YES;
135
+ ENABLE_NS_ASSERTIONS = NO;
136
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
137
+ GCC_C_LANGUAGE_STANDARD = gnu99;
138
+ GCC_NO_COMMON_BLOCKS = YES;
139
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
140
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
141
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
142
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
143
+ GCC_WARN_UNUSED_FUNCTION = YES;
144
+ GCC_WARN_UNUSED_VARIABLE = YES;
145
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
146
+ MTL_ENABLE_DEBUG_INFO = NO;
147
+ SDKROOT = iphoneos;
148
+ VALIDATE_PRODUCT = YES;
149
+ };
150
+ name = Release;
151
+ };
152
+ /* End XCBuildConfiguration section */
153
+
154
+ /* Begin XCConfigurationList section */
155
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "KalapaEkyc" */ = {
156
+ isa = XCConfigurationList;
157
+ buildConfigurations = (
158
+ 58B511ED1A9E6C8500147676 /* Debug */,
159
+ 58B511EE1A9E6C8500147676 /* Release */,
160
+ );
161
+ defaultConfigurationIsVisible = 0;
162
+ defaultConfigurationName = Release;
163
+ };
164
+ /* End XCConfigurationList section */
165
+ };
166
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
167
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>KalapaEkyc.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ const {
9
+ KalapaEkyc
10
+ } = _reactNative.NativeModules;
11
+ var _default = exports.default = KalapaEkyc;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","KalapaEkyc","NativeModules","_default","exports","default"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst { KalapaEkyc } = NativeModules;\n\nexport default KalapaEkyc;\n\n\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC;AAAW,CAAC,GAAGC,0BAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtBJ,UAAU","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import { NativeModules } from 'react-native';
2
+ const {
3
+ KalapaEkyc
4
+ } = NativeModules;
5
+ export default KalapaEkyc;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","KalapaEkyc"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst { KalapaEkyc } = NativeModules;\n\nexport default KalapaEkyc;\n\n\n\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAM;EAAEC;AAAW,CAAC,GAAGD,aAAa;AAEpC,eAAeC,UAAU","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ declare const KalapaEkyc: any;
2
+ export default KalapaEkyc;
package/package.json ADDED
@@ -0,0 +1,157 @@
1
+ {
2
+ "name": "react-native-kalapa-ekyc",
3
+ "version": "0.1.0",
4
+ "description": "kalapa ekyc ",
5
+ "main": "lib/commonjs/index.js",
6
+ "module": "lib/module/index.js",
7
+ "types": "lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index.tsx",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "!**/__tests__",
14
+ "!**/__fixtures__",
15
+ "!**/__mocks__",
16
+ "android",
17
+ "ios",
18
+ "cpp",
19
+ "react-native-kalapa-ekyc.podspec",
20
+ "!lib/typescript/example",
21
+ "!android/build",
22
+ "!ios/build"
23
+ ],
24
+ "scripts": {
25
+ "test": "jest",
26
+ "typescript": "tsc --noEmit",
27
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
+ "prepare": "bob build",
29
+ "release": "release-it",
30
+ "example": "yarn --cwd example",
31
+ "pods": "cd example && pod-install --quiet",
32
+ "bootstrap": "yarn example && yarn && yarn pods"
33
+ },
34
+ "keywords": [
35
+ "react-native",
36
+ "ios",
37
+ "android"
38
+ ],
39
+ "repository": "https://github.com/tobe-ookii/react-native-kalapa-ekyc",
40
+ "author": "tobe-ookii <nguyengiatu.dev@gmail.com> (https://github.com/tobe-ookii/react-native-kalapa-ekyc)",
41
+ "license": "MIT",
42
+ "bugs": {
43
+ "url": "https://github.com/tobe-ookii/react-native-kalapa-ekyc/issues"
44
+ },
45
+ "homepage": "https://github.com/tobe-ookii/react-native-kalapa-ekyc#readme",
46
+ "publishConfig": {
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "devDependencies": {
50
+ "@commitlint/config-conventional": "^11.0.0",
51
+ "@react-native-community/bob": "^0.17.1",
52
+ "@react-native-community/eslint-config": "^2.0.0",
53
+ "@release-it/conventional-changelog": "^2.0.0",
54
+ "@types/jest": "^26.0.0",
55
+ "@types/react": "^16.9.19",
56
+ "@types/react-native": "0.62.13",
57
+ "commitlint": "^11.0.0",
58
+ "eslint": "^7.2.0",
59
+ "eslint-config-prettier": "^7.0.0",
60
+ "eslint-plugin-prettier": "^3.1.3",
61
+ "husky": "^6.0.0",
62
+ "jest": "^26.0.1",
63
+ "pod-install": "^0.1.0",
64
+ "prettier": "^2.0.5",
65
+ "react": "16.13.1",
66
+ "react-native": "0.63.4",
67
+ "react-native-builder-bob": "^0.18.0",
68
+ "release-it": "^14.2.2",
69
+ "typescript": "^4.1.3"
70
+ },
71
+ "peerDependencies": {
72
+ "react": "*",
73
+ "react-native": "*"
74
+ },
75
+ "jest": {
76
+ "preset": "react-native",
77
+ "modulePathIgnorePatterns": [
78
+ "<rootDir>/example/node_modules",
79
+ "<rootDir>/lib/"
80
+ ]
81
+ },
82
+ "commitlint": {
83
+ "extends": [
84
+ "@commitlint/config-conventional"
85
+ ]
86
+ },
87
+ "release-it": {
88
+ "git": {
89
+ "commitMessage": "chore: release ${version}",
90
+ "tagName": "v${version}"
91
+ },
92
+ "npm": {
93
+ "publish": true
94
+ },
95
+ "github": {
96
+ "release": true
97
+ },
98
+ "plugins": {
99
+ "@release-it/conventional-changelog": {
100
+ "preset": "angular"
101
+ }
102
+ }
103
+ },
104
+ "eslintConfig": {
105
+ "root": true,
106
+ "extends": [
107
+ "@react-native-community",
108
+ "prettier"
109
+ ],
110
+ "rules": {
111
+ "prettier/prettier": [
112
+ "error",
113
+ {
114
+ "quoteProps": "consistent",
115
+ "singleQuote": true,
116
+ "tabWidth": 2,
117
+ "trailingComma": "es5",
118
+ "useTabs": false
119
+ }
120
+ ]
121
+ }
122
+ },
123
+ "eslintIgnore": [
124
+ "node_modules/",
125
+ "lib/"
126
+ ],
127
+ "prettier": {
128
+ "quoteProps": "consistent",
129
+ "singleQuote": true,
130
+ "tabWidth": 2,
131
+ "trailingComma": "es5",
132
+ "useTabs": false
133
+ },
134
+ "react-native-builder-bob": {
135
+ "source": "src",
136
+ "output": "lib",
137
+ "targets": [
138
+ "commonjs",
139
+ "module",
140
+ [
141
+ "typescript",
142
+ {
143
+ "project": "tsconfig.build.json"
144
+ }
145
+ ]
146
+ ]
147
+ },
148
+ "@react-native-community/bob": {
149
+ "source": "src",
150
+ "output": "lib",
151
+ "targets": [
152
+ "commonjs",
153
+ "module",
154
+ "typescript"
155
+ ]
156
+ }
157
+ }
@@ -0,0 +1,21 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "react-native-kalapa-ekyc"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "13.0" }
14
+ s.source = { :git => "https://gitlab.com/littlepjg/klp-ekyc-react-native.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm}"
17
+
18
+ s.dependency "React-Core"
19
+ s.dependency "KalapaEkycSDK"
20
+
21
+ end
package/src/index.tsx ADDED
@@ -0,0 +1,8 @@
1
+ import { NativeModules } from 'react-native';
2
+
3
+ const { KalapaEkyc } = NativeModules;
4
+
5
+ export default KalapaEkyc;
6
+
7
+
8
+