react-native-hyperkyc-sdk 0.29.3 → 0.30.2
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/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativehyperkycsdk/HyperkycSdkModule.java +21 -3
- package/android/src/main/java/com/reactnativehyperkycsdk/HyperkycSdkPackage.java +13 -11
- package/ios/HyperkycSdk.swift +1 -1
- package/package.json +1 -1
- package/react-native-hyperkyc-sdk.podspec +1 -1
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.30.1@aar', {
|
|
60
60
|
transitive = true
|
|
61
61
|
})
|
|
62
62
|
|
|
@@ -13,6 +13,7 @@ import com.facebook.react.bridge.Callback;
|
|
|
13
13
|
import com.facebook.react.bridge.ReadableMap;
|
|
14
14
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
15
15
|
import com.facebook.react.bridge.ReadableNativeMap;
|
|
16
|
+
import com.facebook.react.bridge.ReadableType;
|
|
16
17
|
import com.facebook.react.bridge.WritableMap;
|
|
17
18
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
18
19
|
import com.google.gson.Gson;
|
|
@@ -110,8 +111,25 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
110
111
|
ReadableMapKeySetIterator iterator = rm.keySetIterator();
|
|
111
112
|
while (iterator.hasNextKey()) {
|
|
112
113
|
String key = iterator.nextKey();
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
ReadableType type = rm.getType(key);
|
|
115
|
+
|
|
116
|
+
// Handle different types of values
|
|
117
|
+
switch (type) {
|
|
118
|
+
case Number:
|
|
119
|
+
double numberValue = rm.getDouble(key);
|
|
120
|
+
// Check if the value is an integer by comparing its fractional part
|
|
121
|
+
if (numberValue == Math.rint(numberValue)) { // rint rounds to the nearest integer
|
|
122
|
+
map.put(key, (int) numberValue); // It's an int, cast and put as Integer
|
|
123
|
+
} else {
|
|
124
|
+
map.put(key, numberValue); // It's a double
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case Boolean:
|
|
128
|
+
map.put(key, rm.getBoolean(key));
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
map.put(key, rm.getString(key));
|
|
132
|
+
}
|
|
115
133
|
}
|
|
116
134
|
return map;
|
|
117
135
|
}
|
|
@@ -127,7 +145,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
|
|
|
127
145
|
Boolean useLocation = kycConfig.hasKey("useLocation") ? kycConfig.getBoolean("useLocation") : null;
|
|
128
146
|
String uniqueId = kycConfig.hasKey("uniqueId") ? kycConfig.getString("uniqueId") : null;
|
|
129
147
|
Map<String, String> metadata = new HashMap<>();
|
|
130
|
-
metadata.put("sdk-version", "0.
|
|
148
|
+
metadata.put("sdk-version", "0.30.1");
|
|
131
149
|
metadata.put("sdk-type", "React Native");
|
|
132
150
|
if (accessToken == null) {
|
|
133
151
|
assert appId != null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.reactnativehyperkycsdk;
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
import androidx.annotation.NonNull;
|
|
4
5
|
|
|
5
6
|
import com.facebook.react.ReactPackage;
|
|
@@ -13,21 +14,22 @@ import java.util.Collections;
|
|
|
13
14
|
import java.util.List;
|
|
14
15
|
|
|
15
16
|
public class HyperkycSdkPackage implements ReactPackage {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
@NonNull
|
|
18
|
+
@Override
|
|
19
|
+
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
20
|
+
List<NativeModule> modules = new ArrayList<>();
|
|
21
|
+
modules.add(new HyperkycSdkModule(reactContext));
|
|
22
|
+
return modules;
|
|
23
|
+
}
|
|
24
|
+
|
|
23
25
|
|
|
24
26
|
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
@NonNull
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
@Override
|
|
32
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
33
|
+
return Collections.emptyList();
|
|
34
|
+
}
|
|
33
35
|
}
|
package/ios/HyperkycSdk.swift
CHANGED
|
@@ -32,7 +32,7 @@ class Hyperkyc: NSObject {
|
|
|
32
32
|
let useLocation = _config["useLocation"] as? Bool
|
|
33
33
|
let uniqueId = _config["uniqueId"] as? String
|
|
34
34
|
let metadata: [String: String] = [
|
|
35
|
-
"sdk-version": "0.
|
|
35
|
+
"sdk-version": "0.30.1",
|
|
36
36
|
"sdk-type": "React Native"
|
|
37
37
|
]
|
|
38
38
|
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.static_framework = true
|
|
18
18
|
s.weak_frameworks = ['CoreNFC', 'CryptoKit']
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "HyperKYC", "0.
|
|
20
|
+
s.dependency "HyperKYC", "0.30.1"
|
|
21
21
|
# Need these lines to support HyperKYC framework
|
|
22
22
|
s.preserve_paths = 'HyperKYC.framework'
|
|
23
23
|
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework HyperKYC' }
|