react-native-hyperkyc-sdk 0.18.5 → 0.19.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.
- package/CHANGELOG.md +4 -0
- package/README.md +7 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativehyperkycsdk/HyperkycSdkModule.java +16 -1
- package/ios/HyperkycSdk.m +1 -0
- package/ios/HyperkycSdk.swift +12 -0
- package/package.json +1 -1
- package/react-native-hyperkyc-sdk.podspec +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -29,6 +29,13 @@ const { Hyperkyc } = NativeModules
|
|
|
29
29
|
|
|
30
30
|
configDictionary["transactionId"] = transactionId
|
|
31
31
|
configDictionary["workflowId"] = "<workflow-id>"
|
|
32
|
+
|
|
33
|
+
// Generate unique ID
|
|
34
|
+
Hyperkyc.createUniqueId(uniqueId =>{
|
|
35
|
+
console.log(uniqueId)
|
|
36
|
+
configDictionary["uniqueId"] = uniqueId;
|
|
37
|
+
});
|
|
38
|
+
|
|
32
39
|
Hyperkyc.launch(configDictionary, function(response){
|
|
33
40
|
console.log(response)
|
|
34
41
|
})
|
package/android/build.gradle
CHANGED
|
@@ -56,7 +56,7 @@ repositories {
|
|
|
56
56
|
dependencies {
|
|
57
57
|
//noinspection GradleDynamicVersion
|
|
58
58
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
59
|
-
implementation('co.hyperverge:hyperkyc:0.
|
|
59
|
+
implementation('co.hyperverge:hyperkyc:0.19.0@aar', {
|
|
60
60
|
transitive = true
|
|
61
61
|
})
|
|
62
62
|
|
|
@@ -44,6 +44,12 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
44
44
|
return NAME;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
|
|
48
|
+
@ReactMethod
|
|
49
|
+
public void createUniqueId(Callback callback) {
|
|
50
|
+
callback.invoke(HyperKyc.createUniqueId());
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
@ReactMethod
|
|
48
54
|
public void launch(ReadableMap kycConfig, Callback resultCallback) {
|
|
49
55
|
ReactActivity currentActivity = (ReactActivity) getCurrentActivity();
|
|
@@ -76,6 +82,8 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
|
|
86
|
+
|
|
79
87
|
private void parseKYCResult(HyperKycResult hyperKycResult, Callback callback) {
|
|
80
88
|
try {
|
|
81
89
|
Gson gson = new Gson();
|
|
@@ -114,7 +122,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
114
122
|
ReadableMap inputs = kycConfig.hasKey("inputs") ? kycConfig.getMap("inputs") : null;
|
|
115
123
|
String defaultLangCode = kycConfig.hasKey("defaultLangCode") ? kycConfig.getString("defaultLangCode") : null;
|
|
116
124
|
Boolean useLocation = kycConfig.hasKey("useLocation") ? kycConfig.getBoolean("useLocation") : null;
|
|
117
|
-
|
|
125
|
+
String uniqueId = kycConfig.hasKey("uniqueId") ? kycConfig.getString("uniqueId") : null;
|
|
118
126
|
if (accessToken == null) {
|
|
119
127
|
assert appId != null;
|
|
120
128
|
assert appKey != null;
|
|
@@ -130,6 +138,10 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
130
138
|
if (useLocation != null) {
|
|
131
139
|
hyperKycConfig.setUseLocation(useLocation);
|
|
132
140
|
}
|
|
141
|
+
if (uniqueId != null) {
|
|
142
|
+
hyperKycConfig.setUniqueId(uniqueId);
|
|
143
|
+
}
|
|
144
|
+
|
|
133
145
|
return hyperKycConfig;
|
|
134
146
|
} else {
|
|
135
147
|
assert workflowId != null;
|
|
@@ -144,6 +156,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
144
156
|
if (useLocation != null) {
|
|
145
157
|
hyperKycConfig.setUseLocation(useLocation);
|
|
146
158
|
}
|
|
159
|
+
if (uniqueId != null) {
|
|
160
|
+
hyperKycConfig.setUniqueId(uniqueId);
|
|
161
|
+
}
|
|
147
162
|
return hyperKycConfig;
|
|
148
163
|
}
|
|
149
164
|
}
|
package/ios/HyperkycSdk.m
CHANGED
package/ios/HyperkycSdk.swift
CHANGED
|
@@ -8,6 +8,13 @@ class Hyperkyc: NSObject {
|
|
|
8
8
|
@objc static func requiresMainQueueSetup() -> Bool {return true}
|
|
9
9
|
|
|
10
10
|
internal var skipKeysArray : [String] = ["responseResult", "variables", "moduleId"]
|
|
11
|
+
|
|
12
|
+
@objc(createUniqueId:)
|
|
13
|
+
func createUniqueId(_callback: @escaping RCTResponseSenderBlock) {
|
|
14
|
+
let uniqueId = HyperKyc.createUniqueId()
|
|
15
|
+
_callback([uniqueId])
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
@objc(launch:callback:)
|
|
12
19
|
func launch(_config: NSDictionary, callback: @escaping RCTResponseSenderBlock) {
|
|
13
20
|
let appId = _config["appId"] as? String
|
|
@@ -18,6 +25,7 @@ class Hyperkyc: NSObject {
|
|
|
18
25
|
let defaultLangCode = _config["defaultLangCode"] as? String
|
|
19
26
|
let inputs = _config["inputs"] as? [String: String]
|
|
20
27
|
let useLocation = _config["useLocation"] as? Bool
|
|
28
|
+
let uniqueId = _config["uniqueId"] as? String
|
|
21
29
|
|
|
22
30
|
DispatchQueue.main.async {
|
|
23
31
|
let controller = RCTPresentedViewController()
|
|
@@ -40,6 +48,10 @@ class Hyperkyc: NSObject {
|
|
|
40
48
|
if let useLocation = useLocation {
|
|
41
49
|
hyperKYCConfig.setUseLocation(shouldUse: useLocation)
|
|
42
50
|
}
|
|
51
|
+
|
|
52
|
+
if let uniqueId = uniqueId {
|
|
53
|
+
hyperKYCConfig.setUniqueId(uuid: uniqueId)
|
|
54
|
+
}
|
|
43
55
|
|
|
44
56
|
//launch HyperKyc
|
|
45
57
|
HyperKyc.launch(controller!, hyperKycConfig: hyperKYCConfig) { hyperKycResult in
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
17
|
s.static_framework = true
|
|
18
18
|
s.dependency "React-Core"
|
|
19
|
-
s.dependency "HyperKYC", "0.
|
|
19
|
+
s.dependency "HyperKYC", "0.19.0"
|
|
20
20
|
# Need these lines to support HyperKYC framework
|
|
21
21
|
s.preserve_paths = 'HyperKYC.framework'
|
|
22
22
|
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework HyperKYC' }
|