react-native-hyperkyc-sdk 0.21.1 → 0.22.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/README.md CHANGED
@@ -36,6 +36,9 @@ const { Hyperkyc } = NativeModules
36
36
  configDictionary["uniqueId"] = uniqueId;
37
37
  });
38
38
 
39
+ //Prefetch configs
40
+ Hyperkyc.prefetch(appID, workflowID)
41
+
39
42
  Hyperkyc.launch(configDictionary, function(response){
40
43
  console.log(response)
41
44
  })
@@ -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.21.2@aar', {
59
+ implementation('co.hyperverge:hyperkyc:0.22.0@aar', {
60
60
  transitive = true
61
61
  })
62
62
 
@@ -49,6 +49,14 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
49
49
  public void createUniqueId(Callback callback) {
50
50
  callback.invoke(HyperKyc.createUniqueId());
51
51
  }
52
+
53
+ @ReactMethod
54
+ public void prefetch(String appId, String workflowId) {
55
+ if (getReactApplicationContext() != null) {
56
+ HyperKyc.prefetch(getReactApplicationContext(), appId, workflowId);
57
+ }
58
+ }
59
+
52
60
 
53
61
  @ReactMethod
54
62
  public void launch(ReadableMap kycConfig, Callback resultCallback) {
@@ -101,19 +109,18 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
101
109
  }
102
110
  }
103
111
 
104
- private Map<String, String> processInputsArray(ReadableMap inputs) {
105
- Map<String, String> inputsMap = new HashMap<>();
106
- ReadableMapKeySetIterator iterator = inputs.keySetIterator();
112
+ private Map<String, String> processReadableMap(ReadableMap rm) {
113
+ Map<String, String> map = new HashMap<>();
114
+ ReadableMapKeySetIterator iterator = rm.keySetIterator();
107
115
  while (iterator.hasNextKey()) {
108
116
  String key = iterator.nextKey();
109
- String value = inputs.getString(key);
110
- inputsMap.put(key, value);
117
+ String value = rm.getString(key);
118
+ map.put(key, value);
111
119
  }
112
- return inputsMap;
120
+ return map;
113
121
  }
114
122
 
115
123
  private HyperKycConfig getHyperKycConfigFromMap(ReadableMap kycConfig) {
116
-
117
124
  String appId = kycConfig.hasKey("appId") ? kycConfig.getString("appId") : null;
118
125
  String appKey = kycConfig.hasKey("appKey") ? kycConfig.getString("appKey") : null;
119
126
  String accessToken = kycConfig.hasKey("accessToken") ? kycConfig.getString("accessToken") : null;
@@ -123,6 +130,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
123
130
  String defaultLangCode = kycConfig.hasKey("defaultLangCode") ? kycConfig.getString("defaultLangCode") : null;
124
131
  Boolean useLocation = kycConfig.hasKey("useLocation") ? kycConfig.getBoolean("useLocation") : null;
125
132
  String uniqueId = kycConfig.hasKey("uniqueId") ? kycConfig.getString("uniqueId") : null;
133
+ Map<String, String> map = new HashMap<>();
134
+ metadata.put("sdk-version", "0.22.0");
135
+ metadata.put("sdk-type", "React Native");
126
136
  if (accessToken == null) {
127
137
  assert appId != null;
128
138
  assert appKey != null;
@@ -130,7 +140,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
130
140
  assert transactionId != null;
131
141
  HyperKycConfig hyperKycConfig = new HyperKycConfig(appId, appKey, workflowId, transactionId);
132
142
  if (inputs != null) {
133
- hyperKycConfig.setInputs(processInputsArray(inputs));
143
+ hyperKycConfig.setInputs(processReadableMap(inputs));
134
144
  }
135
145
  if (defaultLangCode != null) {
136
146
  hyperKycConfig.setDefaultLangCode(defaultLangCode);
@@ -139,8 +149,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
139
149
  hyperKycConfig.setUseLocation(useLocation);
140
150
  }
141
151
  if (uniqueId != null) {
142
- hyperKycConfig.setUniqueId(uniqueId);
152
+ hyperKycConfig.setUniqueId(uniqueId);
143
153
  }
154
+ hyperKycConfig.addMetadata(metadata);
144
155
 
145
156
  return hyperKycConfig;
146
157
  } else {
@@ -148,7 +159,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
148
159
  assert transactionId != null;
149
160
  HyperKycConfig hyperKycConfig = new HyperKycConfig(accessToken, workflowId, transactionId);
150
161
  if (inputs != null) {
151
- hyperKycConfig.setInputs(processInputsArray(inputs));
162
+ hyperKycConfig.setInputs(processReadableMap(inputs));
152
163
  }
153
164
  if (defaultLangCode != null) {
154
165
  hyperKycConfig.setDefaultLangCode(defaultLangCode);
@@ -159,6 +170,8 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule {
159
170
  if (uniqueId != null) {
160
171
  hyperKycConfig.setUniqueId(uniqueId);
161
172
  }
173
+ hyperKycConfig.addMetadata(metadata);
174
+
162
175
  return hyperKycConfig;
163
176
  }
164
177
  }
package/ios/HyperkycSdk.m CHANGED
@@ -5,6 +5,7 @@
5
5
  @interface RCT_EXTERN_MODULE(Hyperkyc, NSObject)
6
6
  RCT_EXTERN_METHOD(launch: (NSDictionary*)config callback:(RCTResponseSenderBlock)callback)
7
7
  RCT_EXTERN_METHOD(createUniqueId: (RCTResponseSenderBlock*)callback)
8
+ RCT_EXTERN_METHOD(prefetch: (NSString*)appId workflowId:(NSString*)workflowId)
8
9
 
9
10
  + (BOOL) requiresMainQueueSetup {
10
11
  return YES;
@@ -15,6 +15,11 @@ class Hyperkyc: NSObject {
15
15
  _callback([uniqueId])
16
16
  }
17
17
 
18
+ @objc(prefetch:workflowId:)
19
+ func prefetch(_appId: String, workflowId: String) {
20
+ HyperKyc.prefetch(appId: _appId, workflowId: workflowId)
21
+ }
22
+
18
23
  @objc(launch:callback:)
19
24
  func launch(_config: NSDictionary, callback: @escaping RCTResponseSenderBlock) {
20
25
  let appId = _config["appId"] as? String
@@ -26,6 +31,10 @@ class Hyperkyc: NSObject {
26
31
  let inputs = _config["inputs"] as? [String: String]
27
32
  let useLocation = _config["useLocation"] as? Bool
28
33
  let uniqueId = _config["uniqueId"] as? String
34
+ let metadata: [String: String] = [
35
+ "sdk-version": "0.22.0"
36
+ "sdk-type": "React Native"
37
+ ]
29
38
 
30
39
  DispatchQueue.main.async {
31
40
  let controller = RCTPresentedViewController()
@@ -38,7 +47,6 @@ class Hyperkyc: NSObject {
38
47
  else {
39
48
  hyperKYCConfig = HyperKycConfig(appId: appId!, appKey: appKey!, workflowId: workflowId!, transactionId: transactionId!)
40
49
  }
41
-
42
50
  if let inputs = inputs {
43
51
  hyperKYCConfig.setInputs(inputs: inputs)
44
52
  }
@@ -48,10 +56,10 @@ class Hyperkyc: NSObject {
48
56
  if let useLocation = useLocation {
49
57
  hyperKYCConfig.setUseLocation(shouldUse: useLocation)
50
58
  }
51
-
52
59
  if let uniqueId = uniqueId {
53
60
  hyperKYCConfig.setUniqueId(uuid: uniqueId)
54
61
  }
62
+ hyperKycConfig.addMetadata(metadata: metadata)
55
63
 
56
64
  //launch HyperKyc
57
65
  HyperKyc.launch(controller!, hyperKycConfig: hyperKYCConfig) { hyperKycResult in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperkyc-sdk",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "description": "React Native wrapper for HyperKYC SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -15,8 +15,9 @@ Pod::Spec.new do |s|
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
  s.static_framework = true
18
+ s.weak_frameworks = ['CoreNFC', 'CryptoKit']
18
19
  s.dependency "React-Core"
19
- s.dependency "HyperKYC", "0.21.0"
20
+ s.dependency "HyperKYC", "0.22.0"
20
21
  # Need these lines to support HyperKYC framework
21
22
  s.preserve_paths = 'HyperKYC.framework'
22
23
  s.xcconfig = { 'OTHER_LDFLAGS' => '-framework HyperKYC' }
package/CHANGELOG.md DELETED
@@ -1,167 +0,0 @@
1
- # 0.21.1 [27 Mar 2024]
2
- - Upgrade native android HyperKyc to `0.21.2`
3
-
4
- # 0.21.0 [29 Feb 2024]
5
- - Upgrade native android HyperKyc to `0.21.0`
6
- - Upgrade native iOS HyperKyc to `0.21.0`
7
-
8
- # 0.20.2 [27 Feb 2024]
9
- - Upgrade native android HyperKyc to `0.20.3`
10
- - Upgrade native iOS HyperKyc to `0.20.1`
11
-
12
- # 0.20.1 [25 Jan 2024]
13
- - Upgrade native android HyperKyc to `0.20.1`
14
-
15
- # 0.20.0 [23 Jan 2024]
16
- - Upgrade native android HyperKyc to `0.20.0`
17
- - Upgrade native iOS HyperKyc to `0.20.0`
18
-
19
- # 0.19.0 [23 Jan 2024]
20
- - Upgrade native android HyperKyc to `0.19.0`
21
- - Upgrade native iOS HyperKyc to `0.19.0`
22
-
23
- # 0.18.5 [18 Jan 2024]
24
- - Upgrade native android HyperKyc to `0.18.5`
25
- - Upgrade native iOS HyperKyc to `0.18.3`
26
-
27
- # 0.18.4 [17 Jan 2024]
28
- - Upgrade native android HyperKyc to `0.18.4`
29
- - Upgrade native iOS HyperKyc to `0.18.3`
30
-
31
- # 0.18.3 [17 Jan 2024]
32
- - Upgrade native android HyperKyc to `0.18.3`
33
- - Upgrade native iOS HyperKyc to `0.18.2`
34
-
35
- # 0.18.2 [8 Jan 2024]
36
- - Upgrade native android HyperKyc to `0.18.2`
37
- - Upgrade native iOS HyperKyc to `0.18.2`
38
-
39
- # 0.18.1 [12 Dec 2023]
40
- - Upgrade native android HyperKyc to `0.18.1`
41
- - Upgrade native iOS HyperKyc to `0.18.1`
42
-
43
- # 0.18.0 [20 Nov 2023]
44
- - Upgrade native android HyperKyc to `0.18.0`
45
- - Upgrade native iOS HyperKyc to `0.18.0`
46
-
47
- # 0.17.1 [27 Oct 2023]
48
- - Upgrade native android HyperKyc to `0.17.3`
49
-
50
- # 0.17.0 [23 Oct 2023]
51
- - Upgrade native android HyperKyc to `0.17.2`
52
- - Upgrade native iOS HyperKyc to `0.17.0`
53
-
54
- # 0.16.0 [23 Oct 2023]
55
- - Upgrade native android HyperKyc to `0.16.0`
56
- - Upgrade native iOS HyperKyc to `0.16.0`
57
-
58
-
59
- # 0.15.1 [11 Oct 2023]
60
- - Upgrade native android HyperKyc to `0.15.1`
61
-
62
- # 0.15.0 [16 Sep 2023]
63
- - Upgrade native android HyperKyc to `0.15.0`
64
- - Upgrade native iOS HyperKYC to `0.15.0`
65
-
66
- # 0.14.0 [21 Aug 2023]
67
- - Upgrade native android HyperKyc to `0.14.0`
68
- - Upgrade native iOS HyperKYC to `0.14.0`
69
-
70
-
71
- # 0.13.0 [31 Jul 2023]
72
- - Upgrade native android HyperKyc to `0.13.0`
73
- - Upgrade native iOS HyperKYC to `0.13.0`
74
-
75
-
76
- # 0.12.0 [3 Jul 2023]
77
- - Upgrade native android HyperKyc to `0.12.0`
78
- - Upgrade native iOS HyperKYC to `0.12.0`
79
-
80
- # 0.11.0 [23 Jun 2023]
81
- - Upgrade native android HyperKyc to `0.11.0`
82
- - Upgrade native iOS HyperKYC to `0.11.0`
83
-
84
- # 0.10.0 [19 Jun 2023]
85
- - Upgrade native android HyperKyc to `0.10.0`
86
- - Upgrade native iOS HyperKYC to `0.10.1`
87
- # 0.9.2 [14 Jun 2023]
88
- - Fix callback not invoked for accessToken flow
89
-
90
- # 0.9.1 [8 May 2023]
91
- - Upgrade native android HyperKyc to `0.9.1`
92
- - Upgrade native iOS HyperKYC to `0.9.1`
93
-
94
- # 0.8.0 [10 April 2023]
95
- - Upgrade native android HyperKyc to `0.8.0`
96
- - Upgrade native iOS HyperKYC to `0.8.0`
97
-
98
- # 0.7.4 [4 March 2023]
99
- - Upgrade native android HyperKyc to `0.7.4`
100
-
101
- # 0.7.3 [4 March 2023]
102
- - Upgrade native iOS HyperKYC to `0.7.2`
103
- - Upgrade native android HyperKyc to `0.7.3`
104
-
105
- # 0.7.2 [18 Feb 2023]
106
- - Added changes to podspec for iOS framework
107
-
108
- # 0.7.1 [16 Feb 2023]
109
- - Upgrade native iOS HyperKYC to `0.7.1`
110
- - Upgrade native android HyperKyc to `0.7.2`
111
-
112
- # 0.7.0 [8 Feb 2023]
113
- - Upgrade native iOS HyperKYC to `0.7.0`
114
- - Upgrade native android HyperKyc to `0.7.0`
115
-
116
-
117
- # 0.3.14 [10 Jan 2022]
118
- 1. Updated Android SDK to 0.3.14
119
- 2. Updated and fix iOS SDK to 0.3.10
120
-
121
-
122
-
123
- # 0.3.13 [2 Jan 2022]
124
- 1. Updated Android SDK to 0.3.13
125
- 2. Updated and fix iOS SDK to 0.3.9
126
-
127
- # 0.6.0 [2 Jan 2023]
128
- - Upgrade native iOS HyperKYC to `0.6.0`
129
- - Upgrade native android HyperKyc to `0.6.0`
130
-
131
- # 0.5.0 [2 Jan 2023]
132
- - Upgrade native iOS HyperKYC to `0.5.0` - Includes `DocDetect`
133
- - Upgrade native android HyperKyc to `0.5.0` - Includes `DocDetect`
134
- - Update deployment target to 11 (for iOS)
135
- - Update compileSDK version to 33 (for android)
136
- - Made ios framework static. Have to add use_framework! for HyperKYC pod.
137
-
138
- ** Please note that 0.4.0 version does not exist. We have taken this decision to maintain version number consistency between all the platforms that we support **
139
-
140
- # 0.3.12 [12 Dec 2022]
141
- 1. Updated Android SDK to 0.3.12
142
- 2. Updated and fix iOS SDK to 0.3.8
143
-
144
-
145
-
146
- # 0.3.11 [28th Oct 2022]
147
- 1. Updated Android SDK version to 0.3.10
148
-
149
- # 0.3.10 [13th Oct 2022]
150
- 1. Updated Android SDK version to 0.3.8
151
-
152
-
153
- # 0.3.9 [7th Oct 2022]
154
- 1. Updated Android SDK version to 0.3.6
155
-
156
- # 0.3.8 [19 Aug 2022]
157
- 1. Updated Android SDK version to 0.3.2
158
-
159
- # 0.3.7 [11 Aug 2022]
160
- 1. Added support for the new response structure in HyperKYC native SDKs
161
- 2. Added support for default language code
162
-
163
- # 0.3.6 [28 July 2022]
164
- 1. Fixed issue with missing headers in Android
165
-
166
- # 0.3.5 [28 July 2022]
167
- 1. Added support to set custom inputs
package/ios/.DS_Store DELETED
Binary file