@sumsub/cordova-idensic-mobile-sdk-plugin 1.18.2 → 1.18.4
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/demo/config.xml +1 -1
- package/demo/package-lock.json +3544 -3526
- package/demo/package.json +1 -1
- package/demo/platforms/android/android.json +3 -3
- package/demo/platforms/android/app/src/main/AndroidManifest.xml +2 -2
- package/demo/platforms/android/app/src/main/java/main/java/com/sumsub/msdk/plugins/cordova/SNSMobileSdkCordovaPlugin.java +24 -14
- package/demo/platforms/android/app/src/main/res/xml/config.xml +3 -3
- package/demo/platforms/android/build.gradle +1 -1
- package/demo/platforms/android/cordova-idensic-mobile-sdk-plugin/SumSubCordova-build-extras.gradle +2 -2
- package/demo/platforms/android/platform_www/cordova_plugins.js +1 -1
- package/demo/platforms/android/platform_www/plugins/cordova-idensic-mobile-sdk-plugin/dist/SNSMobileSDK.js +1 -1
- package/demo/platforms/ios/Podfile +1 -1
- package/demo/platforms/ios/Podfile.lock +7 -7
- package/demo/platforms/ios/SumSubCordova/Plugins/cordova-idensic-mobile-sdk-plugin/SNSMobileSdkCordovaPlugin.m +11 -1
- package/demo/platforms/ios/SumSubCordova/SumSubCordova-Info.plist +5 -5
- package/demo/platforms/ios/SumSubCordova/config.xml +4 -4
- package/demo/platforms/ios/SumSubCordova.xcodeproj/project.pbxproj +8 -8
- package/demo/platforms/ios/ios.json +1 -1
- package/demo/platforms/ios/platform_www/cordova_plugins.js +1 -1
- package/demo/platforms/ios/platform_www/plugins/cordova-idensic-mobile-sdk-plugin/dist/SNSMobileSDK.js +1 -1
- package/demo/platforms/ios/pods.json +1 -1
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/dist/SNSMobileSDK.js +1 -1
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/package.json +1 -1
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/plugin.xml +4 -4
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/src/android/build-extras.gradle +2 -2
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/src/android/build.gradle +2 -1
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/src/android/src/main/java/com/sumsub/msdk/plugins/cordova/SNSMobileSdkCordovaPlugin.java +24 -14
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/src/ios/SNSMobileSdkCordovaPlugin.m +11 -1
- package/dist/SNSMobileSDK.js +1 -1
- package/package.json +1 -1
- package/plugin.xml +4 -4
- package/src/android/build-extras.gradle +2 -2
- package/src/android/build.gradle +2 -1
- package/src/android/src/main/java/com/sumsub/msdk/plugins/cordova/SNSMobileSdkCordovaPlugin.java +24 -14
- package/src/ios/SNSMobileSdkCordovaPlugin.m +11 -1
- package/demo/plugins/cordova-idensic-mobile-sdk-plugin/src/android/dependencies.gradle +0 -122
- package/src/android/dependencies.gradle +0 -122
|
@@ -4,7 +4,7 @@ import android.content.Intent;
|
|
|
4
4
|
import android.text.TextUtils;
|
|
5
5
|
import android.util.Log;
|
|
6
6
|
import android.webkit.ValueCallback;
|
|
7
|
-
|
|
7
|
+
import androidx.core.content.res.ResourcesCompat;
|
|
8
8
|
import com.google.gson.Gson;
|
|
9
9
|
import com.sumsub.sns.R;
|
|
10
10
|
import com.sumsub.sns.core.SNSActionResult;
|
|
@@ -20,6 +20,8 @@ import com.sumsub.sns.core.data.model.SNSCompletionResult;
|
|
|
20
20
|
import com.sumsub.sns.core.data.model.SNSException;
|
|
21
21
|
import com.sumsub.sns.core.data.model.SNSSDKState;
|
|
22
22
|
import com.sumsub.sns.core.data.model.SNSSupportItem;
|
|
23
|
+
import com.sumsub.sns.core.data.listener.SNSIconHandler;
|
|
24
|
+
import com.sumsub.sns.core.data.model.SNSInitConfig;
|
|
23
25
|
import com.sumsub.sns.prooface.SNSProoface;
|
|
24
26
|
|
|
25
27
|
import org.apache.cordova.CallbackContext;
|
|
@@ -68,6 +70,9 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
68
70
|
String locale = conf.optString("locale");
|
|
69
71
|
boolean isDebug = conf.optBoolean("debug", false);
|
|
70
72
|
JSONObject hasHandlers = conf.getJSONObject("hasHandlers");
|
|
73
|
+
JSONObject applicantConf = conf.optJSONObject("applicantConf");
|
|
74
|
+
String phone = applicantConf.optString("phone");
|
|
75
|
+
String email = applicantConf.optString("email");
|
|
71
76
|
|
|
72
77
|
if (TextUtils.isEmpty(supportEmail)) {
|
|
73
78
|
supportEmail = "support@sumsub.com";
|
|
@@ -80,7 +85,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
80
85
|
if (TextUtils.isEmpty(locale)) {
|
|
81
86
|
locale = Locale.getDefault().getLanguage();
|
|
82
87
|
}
|
|
83
|
-
this.launchSNSMobileSDK(apiUrl, flowName, accessToken, supportEmail, locale, isDebug, hasHandlers, callbackContext);
|
|
88
|
+
this.launchSNSMobileSDK(apiUrl, flowName, accessToken, supportEmail, email, phone, locale, isDebug, hasHandlers, callbackContext);
|
|
84
89
|
return true;
|
|
85
90
|
} else if (action.equals(NEW_TOKEN_ACTION)) {
|
|
86
91
|
newAccessToken = args.getString(0);
|
|
@@ -134,14 +139,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
134
139
|
});
|
|
135
140
|
}
|
|
136
141
|
|
|
137
|
-
private void launchSNSMobileSDK(final String apiUrl, final String flowName, final String accessToken, String supportEmail, final String locale, final boolean isDebug, final JSONObject hasHandlers, CallbackContext callbackContext) {
|
|
138
|
-
final SNSSupportItem supportItem = new SNSSupportItem(
|
|
139
|
-
R.string.sns_support_EMAIL_title,
|
|
140
|
-
R.string.sns_support_EMAIL_description,
|
|
141
|
-
R.drawable.sns_ic_email,
|
|
142
|
-
SNSSupportItem.Type.Email,
|
|
143
|
-
supportEmail, null);
|
|
144
|
-
|
|
142
|
+
private void launchSNSMobileSDK(final String apiUrl, final String flowName, final String accessToken, String supportEmail, String email, String phone, final String locale, final boolean isDebug, final JSONObject hasHandlers, CallbackContext callbackContext) {
|
|
145
143
|
|
|
146
144
|
cordova.getActivity().runOnUiThread(new Runnable() {
|
|
147
145
|
@Override
|
|
@@ -193,7 +191,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
193
191
|
final SNSEventHandler eventHandler = snsEvent -> {
|
|
194
192
|
Map<String, Object> params = new HashMap<>();
|
|
195
193
|
final Map<String, Object> payload = snsEvent.getPayload();
|
|
196
|
-
for (String key: payload.keySet()) {
|
|
194
|
+
for (String key : payload.keySet()) {
|
|
197
195
|
if (key.equals("isCanceled") || key.equals("isCancelled")) {
|
|
198
196
|
params.put("isCancelled", (Boolean) payload.get(key));
|
|
199
197
|
} else {
|
|
@@ -221,10 +219,20 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
221
219
|
snsSdkBuilder = new SNSMobileSDK.Builder(cordova.getActivity(), null, flowName);
|
|
222
220
|
}
|
|
223
221
|
|
|
224
|
-
if (!apiUrl.isEmpty()) {
|
|
222
|
+
if (apiUrl != null && !apiUrl.isEmpty()) {
|
|
225
223
|
snsSdkBuilder.withBaseUrl(apiUrl);
|
|
226
224
|
}
|
|
227
225
|
|
|
226
|
+
final SNSSupportItem supportItem = new SNSSupportItem(
|
|
227
|
+
R.string.sns_support_EMAIL_title,
|
|
228
|
+
R.string.sns_support_EMAIL_description,
|
|
229
|
+
SNSSupportItem.Type.Email,
|
|
230
|
+
supportEmail,
|
|
231
|
+
null,
|
|
232
|
+
SNSIconHandler.SNSCommonIcons.MAIL.getImageName(),
|
|
233
|
+
null
|
|
234
|
+
);
|
|
235
|
+
|
|
228
236
|
snsSdk = snsSdkBuilder
|
|
229
237
|
.withAccessToken(accessToken, () -> {
|
|
230
238
|
Timber.d("SumSub: calling onTokenExpired!");
|
|
@@ -253,10 +261,12 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
253
261
|
.withEventHandler(eventHandler)
|
|
254
262
|
.withSupportItems(Collections.singletonList(supportItem))
|
|
255
263
|
.withLocale(new Locale(locale))
|
|
264
|
+
.withConf(new SNSInitConfig(email, phone))
|
|
256
265
|
.build();
|
|
257
266
|
snsSdk.launch();
|
|
258
267
|
} catch (Exception e) {
|
|
259
268
|
Timber.e(e);
|
|
269
|
+
callbackContext.error("Error:" + e.getMessage());
|
|
260
270
|
}
|
|
261
271
|
|
|
262
272
|
}
|
|
@@ -296,7 +306,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
296
306
|
final SNSSDKState.ActionCompleted action = (SNSSDKState.ActionCompleted) state;
|
|
297
307
|
final JSONObject actionResult = new JSONObject();
|
|
298
308
|
actionResult.put("actionId", action.getActionId());
|
|
299
|
-
actionResult.put("answer", action.getAnswer()
|
|
309
|
+
actionResult.put("answer", action.getAnswer());
|
|
300
310
|
result.put("actionResult", actionResult);
|
|
301
311
|
}
|
|
302
312
|
} catch (JSONException e) {
|
|
@@ -316,7 +326,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
316
326
|
private String mapToString(Map<String, Object> values) {
|
|
317
327
|
StringBuilder sb = new StringBuilder();
|
|
318
328
|
sb.append('{');
|
|
319
|
-
for (String key: values.keySet()) {
|
|
329
|
+
for (String key : values.keySet()) {
|
|
320
330
|
Object value = values.get(key);
|
|
321
331
|
sb.append("'");
|
|
322
332
|
sb.append(key);
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
sdk = [SNSMobileSDK setupWithAccessToken:accessToken
|
|
33
33
|
environment:environment];
|
|
34
|
-
|
|
34
|
+
|
|
35
|
+
if (locale) {
|
|
36
|
+
sdk.locale = locale;
|
|
37
|
+
}
|
|
35
38
|
|
|
36
39
|
} else {
|
|
37
40
|
|
|
@@ -53,6 +56,13 @@
|
|
|
53
56
|
sdk.logLevel = SNSLogLevel_Debug;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
if (params[@"applicantConf"][@"email"]) {
|
|
60
|
+
sdk.initialEmail = params[@"applicantConf"][@"email"];
|
|
61
|
+
}
|
|
62
|
+
if (params[@"applicantConf"][@"phone"]) {
|
|
63
|
+
sdk.initialPhone = params[@"applicantConf"][@"phone"];
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
__weak SNSMobileSdkCordovaPlugin *weakSelf = self;
|
|
57
67
|
|
|
58
68
|
[sdk tokenExpirationHandler:^(void (^ _Nonnull onComplete)(NSString * _Nullable)) {
|
package/dist/SNSMobileSDK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cordova/exec")):"function"==typeof define&&define.amd?define(["cordova/exec"],t):"object"==typeof exports?exports.SNSMobileSDK=t(require("cordova/exec")):e.SNSMobileSDK=t(e["cordova/exec"])}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){const r=n(1),o="SNSMobileSdkCordovaPlugin",i={onStatusChanged:null,onEvent:null,onActionResult:"onActionResultCompleted"};var s=null;function
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cordova/exec")):"function"==typeof define&&define.amd?define(["cordova/exec"],t):"object"==typeof exports?exports.SNSMobileSDK=t(require("cordova/exec")):e.SNSMobileSDK=t(e["cordova/exec"])}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){const r=n(1),o="SNSMobileSdkCordovaPlugin",i={onStatusChanged:null,onEvent:null,onActionResult:"onActionResultCompleted"};var s=null;function a(e){this.sdkConf=e}function u(e,t){return this.apiUrl=e,this.flowName=t,this.debug=!1,this.handlers={},this.applicantConf={},this}a.prototype.dismiss=function(){r(e=>{},e=>{},o,"dismiss",[])},a.prototype.sendEvent=function(e,t){var n=this.sdkConf.handlers[e];if(n){var s=i[e];if(s){var a=function(e,t){r(e=>{},e=>{},o,s,[{error:e,result:t}])};n(t).then(e=>{a(null,e)}).catch(e=>{a(e||new Error("rejected"),null)})}else n(t)}},a.prototype.getNewAccessToken=function(){var e=function(e){r(e=>{},e=>{},o,"setNewAccessToken",[e])};this.sdkConf.tokenExpirationHandler().then(t=>{e(t)}).catch(t=>{console.error(t instanceof Error?t.message:t),e(null)})},a.prototype.launch=function(){let e=this;return console.log("InSumSub",JSON.stringify(this.sdkConf)),new Promise((t,n)=>{s?n(new Error("Aborted since another instance is in use!")):e.sdkConf.accessToken?e.flowName&&!e.sdkConf.apiUrl?n(new Error("API URL is required")):(s=e,r(e=>{s=null,console.log("Promise SumSub Result",JSON.stringify(e)),t(e)},e=>{s=null,console.log("Promise SumSub Error",JSON.stringify(e)),n(e)},o,"launchSNSMobileSDK",[e.sdkConf])):n(new Error("Access token is required"))})},u.prototype.withAccessToken=function(e,t){if(this.accessToken=e,!t||"function"!=typeof t)throw new Error('Invalid parameter, "expirationHandler" must be a function');return this.tokenExpirationHandler=t,this},u.prototype.withHandlers=function(e){if(!e||"object"!=typeof e)throw new Error('Invalid parameter, "withHandlers" expects a hash');return Object.keys(i).forEach(t=>{var n=e[t];if(n){if("function"!=typeof n)throw new Error('Invalid handler, "'+t+'" must be a function');this.handlers[t]=n}}),this},u.prototype.withDebug=function(e){if("boolean"!=typeof e)throw new Error('Invalid parameter, "withDebug" expects a boolean');return this.debug=e,this},u.prototype.withLocale=function(e){if("string"!=typeof e)throw new Error('Invalid parameter, "locale" must be a string');return this.locale=e,this},u.prototype.withSupportEmail=function(e){if("string"!=typeof e)throw new Error('Invalid parameter, "supportEmail" must be a string');return this.supportEmail=e,this},u.prototype.withApplicantConf=function(e){if(!e||"object"!=typeof e)throw new Error('Invalid parameter, "withApplicantConf" expects a hash');return this.applicantConf=e,this},u.prototype.withBaseUrl=function(e){if("string"!=typeof e)throw new Error('Invalid parameter, "baseUrl" must be a string');return this.apiUrl=e,this},u.prototype.onTestEnv=function(){return this.withBaseUrl("https://test-api.sumsub.com")},u.prototype.build=function(){var e={};return Object.keys(this.handlers).forEach(t=>{e[t]=!0}),new a({apiUrl:this.apiUrl,flowName:this.flowName,accessToken:this.accessToken,tokenExpirationHandler:this.tokenExpirationHandler,handlers:this.handlers,hasHandlers:e,locale:this.locale,supportEmail:this.supportEmail,applicantConf:this.applicantConf,debug:this.debug})},e.exports={init:function(e,t){return(new u).withAccessToken(e,t)},Builder:function(e,t){return new u(e,t)},getNewAccessToken:function(){s&&s.getNewAccessToken()},sendEvent:function(e,t){s&&s.sendEvent(e,t)},reset:function(){s=null}}},function(t,n){t.exports=e}])}));
|
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
-
<plugin id="cordova-idensic-mobile-sdk-plugin" version="1.18.
|
|
2
|
+
<plugin id="cordova-idensic-mobile-sdk-plugin" version="1.18.4" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
|
|
4
4
|
<name>cordova-idensic-mobile-sdk-plugin</name>
|
|
5
5
|
<description>Cordova plugin exposing SumSub Mobile SDK</description>
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
<feature name="SNSMobileSdkCordovaPlugin">
|
|
21
21
|
<param name="android-package" value="com.sumsub.msdk.plugins.cordova.SNSMobileSdkCordovaPlugin" />
|
|
22
22
|
</feature>
|
|
23
|
-
<preference name="android-targetSdkVersion" value="
|
|
24
|
-
<preference name="android-compileSdkVersion" value="
|
|
23
|
+
<preference name="android-targetSdkVersion" value="30" />
|
|
24
|
+
<preference name="android-compileSdkVersion" value="30" />
|
|
25
25
|
<preference name="android-buildToolsVersion" value="29.0.3" />
|
|
26
26
|
</config-file>
|
|
27
27
|
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<source url="https://cdn.cocoapods.org/"/>
|
|
72
72
|
</config>
|
|
73
73
|
<pods>
|
|
74
|
-
<pod name="IdensicMobileSDK" spec="=1.18.
|
|
74
|
+
<pod name="IdensicMobileSDK" spec="=1.18.4" />
|
|
75
75
|
</pods>
|
|
76
76
|
</podspec>
|
|
77
77
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
repositories {
|
|
3
|
-
maven { url "https://maven.sumsub.com/repository/maven-public/" }
|
|
4
3
|
google()
|
|
5
4
|
jcenter()
|
|
6
5
|
mavenCentral()
|
|
@@ -17,6 +16,7 @@ allprojects {
|
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
dependencies {
|
|
20
|
-
implementation "com.sumsub.sns:idensic-mobile-sdk:1.18.
|
|
19
|
+
implementation "com.sumsub.sns:idensic-mobile-sdk:1.18.4"
|
|
20
|
+
implementation "com.sumsub.sns:idensic-mobile-sdk-prooface:1.18.4"
|
|
21
21
|
implementation 'com.google.android.material:material:1.3.0'
|
|
22
22
|
}
|
package/src/android/build.gradle
CHANGED
|
@@ -47,7 +47,8 @@ android {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
dependencies {
|
|
50
|
-
implementation "com.sumsub.sns:idensic-mobile-sdk:1.18.
|
|
50
|
+
implementation "com.sumsub.sns:idensic-mobile-sdk:1.18.4"
|
|
51
|
+
implementation "com.sumsub.sns:idensic-mobile-sdk-prooface:1.18.4"
|
|
51
52
|
|
|
52
53
|
implementation 'com.google.android.material:material:1.3.0'
|
|
53
54
|
implementation 'org.apache.cordova:framework:8.1.0'
|
package/src/android/src/main/java/com/sumsub/msdk/plugins/cordova/SNSMobileSdkCordovaPlugin.java
CHANGED
|
@@ -4,7 +4,7 @@ import android.content.Intent;
|
|
|
4
4
|
import android.text.TextUtils;
|
|
5
5
|
import android.util.Log;
|
|
6
6
|
import android.webkit.ValueCallback;
|
|
7
|
-
|
|
7
|
+
import androidx.core.content.res.ResourcesCompat;
|
|
8
8
|
import com.google.gson.Gson;
|
|
9
9
|
import com.sumsub.sns.R;
|
|
10
10
|
import com.sumsub.sns.core.SNSActionResult;
|
|
@@ -20,6 +20,8 @@ import com.sumsub.sns.core.data.model.SNSCompletionResult;
|
|
|
20
20
|
import com.sumsub.sns.core.data.model.SNSException;
|
|
21
21
|
import com.sumsub.sns.core.data.model.SNSSDKState;
|
|
22
22
|
import com.sumsub.sns.core.data.model.SNSSupportItem;
|
|
23
|
+
import com.sumsub.sns.core.data.listener.SNSIconHandler;
|
|
24
|
+
import com.sumsub.sns.core.data.model.SNSInitConfig;
|
|
23
25
|
import com.sumsub.sns.prooface.SNSProoface;
|
|
24
26
|
|
|
25
27
|
import org.apache.cordova.CallbackContext;
|
|
@@ -68,6 +70,9 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
68
70
|
String locale = conf.optString("locale");
|
|
69
71
|
boolean isDebug = conf.optBoolean("debug", false);
|
|
70
72
|
JSONObject hasHandlers = conf.getJSONObject("hasHandlers");
|
|
73
|
+
JSONObject applicantConf = conf.optJSONObject("applicantConf");
|
|
74
|
+
String phone = applicantConf.optString("phone");
|
|
75
|
+
String email = applicantConf.optString("email");
|
|
71
76
|
|
|
72
77
|
if (TextUtils.isEmpty(supportEmail)) {
|
|
73
78
|
supportEmail = "support@sumsub.com";
|
|
@@ -80,7 +85,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
80
85
|
if (TextUtils.isEmpty(locale)) {
|
|
81
86
|
locale = Locale.getDefault().getLanguage();
|
|
82
87
|
}
|
|
83
|
-
this.launchSNSMobileSDK(apiUrl, flowName, accessToken, supportEmail, locale, isDebug, hasHandlers, callbackContext);
|
|
88
|
+
this.launchSNSMobileSDK(apiUrl, flowName, accessToken, supportEmail, email, phone, locale, isDebug, hasHandlers, callbackContext);
|
|
84
89
|
return true;
|
|
85
90
|
} else if (action.equals(NEW_TOKEN_ACTION)) {
|
|
86
91
|
newAccessToken = args.getString(0);
|
|
@@ -134,14 +139,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
134
139
|
});
|
|
135
140
|
}
|
|
136
141
|
|
|
137
|
-
private void launchSNSMobileSDK(final String apiUrl, final String flowName, final String accessToken, String supportEmail, final String locale, final boolean isDebug, final JSONObject hasHandlers, CallbackContext callbackContext) {
|
|
138
|
-
final SNSSupportItem supportItem = new SNSSupportItem(
|
|
139
|
-
R.string.sns_support_EMAIL_title,
|
|
140
|
-
R.string.sns_support_EMAIL_description,
|
|
141
|
-
R.drawable.sns_ic_email,
|
|
142
|
-
SNSSupportItem.Type.Email,
|
|
143
|
-
supportEmail, null);
|
|
144
|
-
|
|
142
|
+
private void launchSNSMobileSDK(final String apiUrl, final String flowName, final String accessToken, String supportEmail, String email, String phone, final String locale, final boolean isDebug, final JSONObject hasHandlers, CallbackContext callbackContext) {
|
|
145
143
|
|
|
146
144
|
cordova.getActivity().runOnUiThread(new Runnable() {
|
|
147
145
|
@Override
|
|
@@ -193,7 +191,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
193
191
|
final SNSEventHandler eventHandler = snsEvent -> {
|
|
194
192
|
Map<String, Object> params = new HashMap<>();
|
|
195
193
|
final Map<String, Object> payload = snsEvent.getPayload();
|
|
196
|
-
for (String key: payload.keySet()) {
|
|
194
|
+
for (String key : payload.keySet()) {
|
|
197
195
|
if (key.equals("isCanceled") || key.equals("isCancelled")) {
|
|
198
196
|
params.put("isCancelled", (Boolean) payload.get(key));
|
|
199
197
|
} else {
|
|
@@ -221,10 +219,20 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
221
219
|
snsSdkBuilder = new SNSMobileSDK.Builder(cordova.getActivity(), null, flowName);
|
|
222
220
|
}
|
|
223
221
|
|
|
224
|
-
if (!apiUrl.isEmpty()) {
|
|
222
|
+
if (apiUrl != null && !apiUrl.isEmpty()) {
|
|
225
223
|
snsSdkBuilder.withBaseUrl(apiUrl);
|
|
226
224
|
}
|
|
227
225
|
|
|
226
|
+
final SNSSupportItem supportItem = new SNSSupportItem(
|
|
227
|
+
R.string.sns_support_EMAIL_title,
|
|
228
|
+
R.string.sns_support_EMAIL_description,
|
|
229
|
+
SNSSupportItem.Type.Email,
|
|
230
|
+
supportEmail,
|
|
231
|
+
null,
|
|
232
|
+
SNSIconHandler.SNSCommonIcons.MAIL.getImageName(),
|
|
233
|
+
null
|
|
234
|
+
);
|
|
235
|
+
|
|
228
236
|
snsSdk = snsSdkBuilder
|
|
229
237
|
.withAccessToken(accessToken, () -> {
|
|
230
238
|
Timber.d("SumSub: calling onTokenExpired!");
|
|
@@ -253,10 +261,12 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
253
261
|
.withEventHandler(eventHandler)
|
|
254
262
|
.withSupportItems(Collections.singletonList(supportItem))
|
|
255
263
|
.withLocale(new Locale(locale))
|
|
264
|
+
.withConf(new SNSInitConfig(email, phone))
|
|
256
265
|
.build();
|
|
257
266
|
snsSdk.launch();
|
|
258
267
|
} catch (Exception e) {
|
|
259
268
|
Timber.e(e);
|
|
269
|
+
callbackContext.error("Error:" + e.getMessage());
|
|
260
270
|
}
|
|
261
271
|
|
|
262
272
|
}
|
|
@@ -296,7 +306,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
296
306
|
final SNSSDKState.ActionCompleted action = (SNSSDKState.ActionCompleted) state;
|
|
297
307
|
final JSONObject actionResult = new JSONObject();
|
|
298
308
|
actionResult.put("actionId", action.getActionId());
|
|
299
|
-
actionResult.put("answer", action.getAnswer()
|
|
309
|
+
actionResult.put("answer", action.getAnswer());
|
|
300
310
|
result.put("actionResult", actionResult);
|
|
301
311
|
}
|
|
302
312
|
} catch (JSONException e) {
|
|
@@ -316,7 +326,7 @@ public class SNSMobileSdkCordovaPlugin extends CordovaPlugin {
|
|
|
316
326
|
private String mapToString(Map<String, Object> values) {
|
|
317
327
|
StringBuilder sb = new StringBuilder();
|
|
318
328
|
sb.append('{');
|
|
319
|
-
for (String key: values.keySet()) {
|
|
329
|
+
for (String key : values.keySet()) {
|
|
320
330
|
Object value = values.get(key);
|
|
321
331
|
sb.append("'");
|
|
322
332
|
sb.append(key);
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
sdk = [SNSMobileSDK setupWithAccessToken:accessToken
|
|
33
33
|
environment:environment];
|
|
34
|
-
|
|
34
|
+
|
|
35
|
+
if (locale) {
|
|
36
|
+
sdk.locale = locale;
|
|
37
|
+
}
|
|
35
38
|
|
|
36
39
|
} else {
|
|
37
40
|
|
|
@@ -53,6 +56,13 @@
|
|
|
53
56
|
sdk.logLevel = SNSLogLevel_Debug;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
if (params[@"applicantConf"][@"email"]) {
|
|
60
|
+
sdk.initialEmail = params[@"applicantConf"][@"email"];
|
|
61
|
+
}
|
|
62
|
+
if (params[@"applicantConf"][@"phone"]) {
|
|
63
|
+
sdk.initialPhone = params[@"applicantConf"][@"phone"];
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
__weak SNSMobileSdkCordovaPlugin *weakSelf = self;
|
|
57
67
|
|
|
58
68
|
[sdk tokenExpirationHandler:^(void (^ _Nonnull onComplete)(NSString * _Nullable)) {
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
def versions = [
|
|
2
|
-
androidPlugin : "4.2.2",
|
|
3
|
-
|
|
4
|
-
kotlin : "1.5.21",
|
|
5
|
-
androidx : "1.4.0-alpha03",
|
|
6
|
-
constraintLayout : "1.1.3",
|
|
7
|
-
coreKtx : "1.1.0",
|
|
8
|
-
lifecycleKtx : "2.2.0",
|
|
9
|
-
fragmentKtx : "1.2.0",
|
|
10
|
-
viewmodelSavedState : "1.0.0",
|
|
11
|
-
coroutines : "1.3.3",
|
|
12
|
-
retrofit : "2.6.4",
|
|
13
|
-
gsonConverter : "2.6.4",
|
|
14
|
-
okhttp : "3.12.11",
|
|
15
|
-
timber : "4.7.1",
|
|
16
|
-
dagger : "2.27",
|
|
17
|
-
assistedInject : "0.5.2",
|
|
18
|
-
butterknife : "10.2.1",
|
|
19
|
-
zoom : '8.7.0@aar',
|
|
20
|
-
cameraView : '2.6.1',
|
|
21
|
-
statusbarUtil : '1.5.1',
|
|
22
|
-
regulaCore : '5.1.2553@aar',
|
|
23
|
-
regulaApi : '5.1.2149@aar',
|
|
24
|
-
gifDrawable : '1.2.19',
|
|
25
|
-
chromeTabs : '23.3.0',
|
|
26
|
-
chromeTabsHelper : '2.0.0',
|
|
27
|
-
|
|
28
|
-
junit : "4.12",
|
|
29
|
-
mockitoCore : "3.3.0",
|
|
30
|
-
mockitoKotlin : "2.2.0",
|
|
31
|
-
robolectric : "4.1",
|
|
32
|
-
coroutinesTest : "1.3.2",
|
|
33
|
-
archCoreTesting : "2.1.0",
|
|
34
|
-
androidJUnit : "1.1.1",
|
|
35
|
-
espresso : "3.2.0",
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
def build = [
|
|
39
|
-
androidPlugin : "com.android.tools.build:gradle:${versions.androidPlugin}",
|
|
40
|
-
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
|
|
41
|
-
butterknifePlugin : "com.jakewharton:butterknife-gradle-plugin:${versions.butterknife}",
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
def buildConfig = [
|
|
45
|
-
buildTools: "29.0.2",
|
|
46
|
-
compileSdk: 30,
|
|
47
|
-
minSdk : 21,
|
|
48
|
-
targetSdk : 30,
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
def apt = [
|
|
52
|
-
daggerCompiler : "com.google.dagger:dagger-compiler:${versions.dagger}",
|
|
53
|
-
daggerAndroidProcessor : "com.google.dagger:dagger-android-processor:${versions.dagger}",
|
|
54
|
-
butterknifeCompiler : "com.jakewharton:butterknife-compiler:${versions.butterknife}",
|
|
55
|
-
assistedInjectProcessor : "com.squareup.inject:assisted-inject-processor-dagger2:${versions.assistedInject}",
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
def external = [
|
|
59
|
-
kotlinStdlib : "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
|
|
60
|
-
coroutinesCore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}",
|
|
61
|
-
coroutinesAndroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}",
|
|
62
|
-
retrofit : "com.squareup.retrofit2:retrofit:${versions.retrofit}",
|
|
63
|
-
gsonConverter : "com.squareup.retrofit2:converter-gson:${versions.gsonConverter}",
|
|
64
|
-
okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
|
|
65
|
-
okhttpLogging : "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
|
|
66
|
-
timber : "com.jakewharton.timber:timber:${versions.timber}",
|
|
67
|
-
dagger : "com.google.dagger:dagger:${versions.dagger}",
|
|
68
|
-
daggerAndroid : "com.google.dagger:dagger-android:${versions.dagger}",
|
|
69
|
-
daggerSuppAndroid : "com.google.dagger:dagger-android-support:${versions.dagger}",
|
|
70
|
-
assistedInject : "com.squareup.inject:assisted-inject-annotations-dagger2:${versions.assistedInject}",
|
|
71
|
-
butterknife : "com.jakewharton:butterknife:${versions.butterknife}",
|
|
72
|
-
zoom : "com.facetec.zoom.sdk:zoom-authentication:${versions.zoom}",
|
|
73
|
-
cameraView : "com.otaliastudios:cameraview:${versions.cameraView}",
|
|
74
|
-
statusbarUtil : "com.jaeger.statusbarutil:library:${versions.statusbarUtil}",
|
|
75
|
-
regulaCore : "com.regula.documentreader.doctype:core:${versions.regulaCore}",
|
|
76
|
-
regulaApi : "com.regula.documentreader:api:${versions.regulaApi}",
|
|
77
|
-
gifDrawable : "pl.droidsonroids.gif:android-gif-drawable:${versions.gifDrawable}",
|
|
78
|
-
chromeTabs : "com.android.support:customtabs:${versions.chromeTabs}",
|
|
79
|
-
chromeTabsHelper : "saschpe.android:customtabs:${versions.chromeTabsHelper}",
|
|
80
|
-
]
|
|
81
|
-
|
|
82
|
-
def lint = [ ]
|
|
83
|
-
|
|
84
|
-
def androidx = [
|
|
85
|
-
material : "com.google.android.material:material:${versions.androidx}",
|
|
86
|
-
annotations : "androidx.annotation:annotation:${versions.androidx}",
|
|
87
|
-
appCompat : "androidx.appcompat:appcompat:${versions.androidx}",
|
|
88
|
-
constraintLayout : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
|
|
89
|
-
coreKtx : "androidx.core:core-ktx:${versions.coreKtx}",
|
|
90
|
-
lifecycleKtx : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycleKtx}",
|
|
91
|
-
livedataKtx : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycleKtx}",
|
|
92
|
-
runtimeKtx : "androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycleKtx}",
|
|
93
|
-
viewmodelKtx : "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycleKtx}",
|
|
94
|
-
lifecycleCommonJava8 : "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycleKtx}",
|
|
95
|
-
viewmodelSavedState : "androidx.lifecycle:lifecycle-viewmodel-savedstate:${versions.viewmodelSavedState}",
|
|
96
|
-
fragmentKtx : "androidx.fragment:fragment-ktx:${versions.fragmentKtx}",
|
|
97
|
-
]
|
|
98
|
-
|
|
99
|
-
def test = [
|
|
100
|
-
junit : "junit:junit:${versions.junit}",
|
|
101
|
-
mokito : "org.mockito:mockito-core:${versions.mockitoCore}",
|
|
102
|
-
mokitoKotlin : "com.nhaarman.mockitokotlin2:mockito-kotlin:${versions.mockitoKotlin}",
|
|
103
|
-
robolectric : "org.robolectric:robolectric:${versions.robolectric}",
|
|
104
|
-
coroutinesTest : "org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.coroutinesTest}",
|
|
105
|
-
archCoreTesting : "androidx.arch.core:core-testing:${versions.archCoreTesting}",
|
|
106
|
-
androidJUnit : "androidx.test.ext:junit:${versions.androidJUnit}",
|
|
107
|
-
espresso : "androidx.test.espresso:espresso-core:${versions.espresso}",
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
ext.config = [
|
|
111
|
-
"build": buildConfig,
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
ext.deps = [
|
|
115
|
-
"androidx": androidx,
|
|
116
|
-
"apt" : apt,
|
|
117
|
-
"build" : build,
|
|
118
|
-
"external": external,
|
|
119
|
-
"lint" : lint,
|
|
120
|
-
"test" : test,
|
|
121
|
-
"versions": versions,
|
|
122
|
-
]
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
def versions = [
|
|
2
|
-
androidPlugin : "4.2.2",
|
|
3
|
-
|
|
4
|
-
kotlin : "1.5.21",
|
|
5
|
-
androidx : "1.4.0-alpha03",
|
|
6
|
-
constraintLayout : "1.1.3",
|
|
7
|
-
coreKtx : "1.1.0",
|
|
8
|
-
lifecycleKtx : "2.2.0",
|
|
9
|
-
fragmentKtx : "1.2.0",
|
|
10
|
-
viewmodelSavedState : "1.0.0",
|
|
11
|
-
coroutines : "1.3.3",
|
|
12
|
-
retrofit : "2.6.4",
|
|
13
|
-
gsonConverter : "2.6.4",
|
|
14
|
-
okhttp : "3.12.11",
|
|
15
|
-
timber : "4.7.1",
|
|
16
|
-
dagger : "2.27",
|
|
17
|
-
assistedInject : "0.5.2",
|
|
18
|
-
butterknife : "10.2.1",
|
|
19
|
-
zoom : '8.7.0@aar',
|
|
20
|
-
cameraView : '2.6.1',
|
|
21
|
-
statusbarUtil : '1.5.1',
|
|
22
|
-
regulaCore : '5.1.2553@aar',
|
|
23
|
-
regulaApi : '5.1.2149@aar',
|
|
24
|
-
gifDrawable : '1.2.19',
|
|
25
|
-
chromeTabs : '23.3.0',
|
|
26
|
-
chromeTabsHelper : '2.0.0',
|
|
27
|
-
|
|
28
|
-
junit : "4.12",
|
|
29
|
-
mockitoCore : "3.3.0",
|
|
30
|
-
mockitoKotlin : "2.2.0",
|
|
31
|
-
robolectric : "4.1",
|
|
32
|
-
coroutinesTest : "1.3.2",
|
|
33
|
-
archCoreTesting : "2.1.0",
|
|
34
|
-
androidJUnit : "1.1.1",
|
|
35
|
-
espresso : "3.2.0",
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
def build = [
|
|
39
|
-
androidPlugin : "com.android.tools.build:gradle:${versions.androidPlugin}",
|
|
40
|
-
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
|
|
41
|
-
butterknifePlugin : "com.jakewharton:butterknife-gradle-plugin:${versions.butterknife}",
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
def buildConfig = [
|
|
45
|
-
buildTools: "29.0.2",
|
|
46
|
-
compileSdk: 30,
|
|
47
|
-
minSdk : 21,
|
|
48
|
-
targetSdk : 30,
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
def apt = [
|
|
52
|
-
daggerCompiler : "com.google.dagger:dagger-compiler:${versions.dagger}",
|
|
53
|
-
daggerAndroidProcessor : "com.google.dagger:dagger-android-processor:${versions.dagger}",
|
|
54
|
-
butterknifeCompiler : "com.jakewharton:butterknife-compiler:${versions.butterknife}",
|
|
55
|
-
assistedInjectProcessor : "com.squareup.inject:assisted-inject-processor-dagger2:${versions.assistedInject}",
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
def external = [
|
|
59
|
-
kotlinStdlib : "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
|
|
60
|
-
coroutinesCore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}",
|
|
61
|
-
coroutinesAndroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}",
|
|
62
|
-
retrofit : "com.squareup.retrofit2:retrofit:${versions.retrofit}",
|
|
63
|
-
gsonConverter : "com.squareup.retrofit2:converter-gson:${versions.gsonConverter}",
|
|
64
|
-
okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
|
|
65
|
-
okhttpLogging : "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
|
|
66
|
-
timber : "com.jakewharton.timber:timber:${versions.timber}",
|
|
67
|
-
dagger : "com.google.dagger:dagger:${versions.dagger}",
|
|
68
|
-
daggerAndroid : "com.google.dagger:dagger-android:${versions.dagger}",
|
|
69
|
-
daggerSuppAndroid : "com.google.dagger:dagger-android-support:${versions.dagger}",
|
|
70
|
-
assistedInject : "com.squareup.inject:assisted-inject-annotations-dagger2:${versions.assistedInject}",
|
|
71
|
-
butterknife : "com.jakewharton:butterknife:${versions.butterknife}",
|
|
72
|
-
zoom : "com.facetec.zoom.sdk:zoom-authentication:${versions.zoom}",
|
|
73
|
-
cameraView : "com.otaliastudios:cameraview:${versions.cameraView}",
|
|
74
|
-
statusbarUtil : "com.jaeger.statusbarutil:library:${versions.statusbarUtil}",
|
|
75
|
-
regulaCore : "com.regula.documentreader.doctype:core:${versions.regulaCore}",
|
|
76
|
-
regulaApi : "com.regula.documentreader:api:${versions.regulaApi}",
|
|
77
|
-
gifDrawable : "pl.droidsonroids.gif:android-gif-drawable:${versions.gifDrawable}",
|
|
78
|
-
chromeTabs : "com.android.support:customtabs:${versions.chromeTabs}",
|
|
79
|
-
chromeTabsHelper : "saschpe.android:customtabs:${versions.chromeTabsHelper}",
|
|
80
|
-
]
|
|
81
|
-
|
|
82
|
-
def lint = [ ]
|
|
83
|
-
|
|
84
|
-
def androidx = [
|
|
85
|
-
material : "com.google.android.material:material:${versions.androidx}",
|
|
86
|
-
annotations : "androidx.annotation:annotation:${versions.androidx}",
|
|
87
|
-
appCompat : "androidx.appcompat:appcompat:${versions.androidx}",
|
|
88
|
-
constraintLayout : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
|
|
89
|
-
coreKtx : "androidx.core:core-ktx:${versions.coreKtx}",
|
|
90
|
-
lifecycleKtx : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycleKtx}",
|
|
91
|
-
livedataKtx : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycleKtx}",
|
|
92
|
-
runtimeKtx : "androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycleKtx}",
|
|
93
|
-
viewmodelKtx : "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycleKtx}",
|
|
94
|
-
lifecycleCommonJava8 : "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycleKtx}",
|
|
95
|
-
viewmodelSavedState : "androidx.lifecycle:lifecycle-viewmodel-savedstate:${versions.viewmodelSavedState}",
|
|
96
|
-
fragmentKtx : "androidx.fragment:fragment-ktx:${versions.fragmentKtx}",
|
|
97
|
-
]
|
|
98
|
-
|
|
99
|
-
def test = [
|
|
100
|
-
junit : "junit:junit:${versions.junit}",
|
|
101
|
-
mokito : "org.mockito:mockito-core:${versions.mockitoCore}",
|
|
102
|
-
mokitoKotlin : "com.nhaarman.mockitokotlin2:mockito-kotlin:${versions.mockitoKotlin}",
|
|
103
|
-
robolectric : "org.robolectric:robolectric:${versions.robolectric}",
|
|
104
|
-
coroutinesTest : "org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.coroutinesTest}",
|
|
105
|
-
archCoreTesting : "androidx.arch.core:core-testing:${versions.archCoreTesting}",
|
|
106
|
-
androidJUnit : "androidx.test.ext:junit:${versions.androidJUnit}",
|
|
107
|
-
espresso : "androidx.test.espresso:espresso-core:${versions.espresso}",
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
ext.config = [
|
|
111
|
-
"build": buildConfig,
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
ext.deps = [
|
|
115
|
-
"androidx": androidx,
|
|
116
|
-
"apt" : apt,
|
|
117
|
-
"build" : build,
|
|
118
|
-
"external": external,
|
|
119
|
-
"lint" : lint,
|
|
120
|
-
"test" : test,
|
|
121
|
-
"versions": versions,
|
|
122
|
-
]
|