@veriff/react-native-sdk 2.5.2 → 2.6.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/android/build.gradle
CHANGED
|
@@ -78,7 +78,7 @@ repositories {
|
|
|
78
78
|
dependencies {
|
|
79
79
|
//noinspection GradleDynamicVersion
|
|
80
80
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
81
|
-
implementation 'com.veriff:veriff-library:
|
|
81
|
+
implementation 'com.veriff:veriff-library:4.+'
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
def configureReactNativePom(def pom) {
|
|
@@ -20,7 +20,7 @@ import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
|
|
20
20
|
import com.facebook.imagepipeline.image.CloseableImage;
|
|
21
21
|
import com.facebook.imagepipeline.request.ImageRequest;
|
|
22
22
|
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
|
23
|
-
import com.veriff.
|
|
23
|
+
import com.veriff.Branding;
|
|
24
24
|
|
|
25
25
|
import org.jetbrains.annotations.NotNull;
|
|
26
26
|
import org.jetbrains.annotations.Nullable;
|
|
@@ -29,7 +29,7 @@ import java.io.IOException;
|
|
|
29
29
|
import java.util.concurrent.CountDownLatch;
|
|
30
30
|
import java.util.concurrent.atomic.AtomicReference;
|
|
31
31
|
|
|
32
|
-
public class ReactNativeImageProvider implements
|
|
32
|
+
public class ReactNativeImageProvider implements Branding.DrawableProvider, Parcelable {
|
|
33
33
|
private static final String TAG = "ReactNativeImage";
|
|
34
34
|
|
|
35
35
|
private final String url;
|
|
@@ -17,22 +17,22 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
17
17
|
import com.facebook.react.bridge.ReadableMap;
|
|
18
18
|
import com.facebook.react.bridge.ReadableType;
|
|
19
19
|
import com.facebook.react.bridge.WritableMap;
|
|
20
|
-
import com.veriff.
|
|
21
|
-
import com.veriff.
|
|
22
|
-
import com.veriff.
|
|
23
|
-
import com.veriff.
|
|
24
|
-
import com.veriff.
|
|
20
|
+
import com.veriff.Branding;
|
|
21
|
+
import com.veriff.Configuration;
|
|
22
|
+
import com.veriff.Result;
|
|
23
|
+
import com.veriff.Result.Status;
|
|
24
|
+
import com.veriff.Sdk;
|
|
25
25
|
|
|
26
26
|
import java.util.HashMap;
|
|
27
27
|
import java.util.Locale;
|
|
28
28
|
import java.util.Map;
|
|
29
29
|
|
|
30
|
-
import
|
|
30
|
+
import com.veriff.GeneralConfig;
|
|
31
31
|
import okhttp3.HttpUrl;
|
|
32
32
|
|
|
33
33
|
import static android.app.Activity.RESULT_CANCELED;
|
|
34
|
-
import static com.veriff.
|
|
35
|
-
import static com.veriff.
|
|
34
|
+
import static com.veriff.Result.Status.CANCELED;
|
|
35
|
+
import static com.veriff.Result.Status.ERROR;
|
|
36
36
|
|
|
37
37
|
public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
38
38
|
/**
|
|
@@ -190,14 +190,14 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
190
190
|
if (data == null) {
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
String token = data.getStringExtra(
|
|
193
|
+
String token = data.getStringExtra(GeneralConfig.INSTANCE.getINTENT_EXTRA_SESSION_URL());
|
|
194
194
|
if (!sessionToken.equals(token) && !startUrl.equals(token)) {
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
reactContext.removeActivityEventListener(this);
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Result veriffResult = Result.fromResultIntent(data);
|
|
201
201
|
WritableMap result = Arguments.createMap();
|
|
202
202
|
result.putString(KEY_TOKEN, sessionToken);
|
|
203
203
|
|
|
@@ -217,7 +217,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
217
217
|
|
|
218
218
|
reactContext.addActivityEventListener(listener);
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
Configuration.Builder configBuilder = new Configuration.Builder();
|
|
221
221
|
|
|
222
222
|
if (configuration.hasKey(KEY_CUSTOM_INTRO_SCREEN)) {
|
|
223
223
|
configBuilder.customIntroScreen(configuration.getBoolean(KEY_CUSTOM_INTRO_SCREEN));
|
|
@@ -226,7 +226,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
226
226
|
if (configuration.hasKey(KEY_BRANDING)) {
|
|
227
227
|
ReadableMap brandConfig = configuration.getMap(KEY_BRANDING);
|
|
228
228
|
if (brandConfig != null) {
|
|
229
|
-
|
|
229
|
+
Branding.Builder branding = new Branding.Builder();
|
|
230
230
|
if (brandConfig.hasKey(KEY_THEME_COLOR)) {
|
|
231
231
|
branding.themeColor(parseColor(brandConfig.getString(KEY_THEME_COLOR)));
|
|
232
232
|
}
|
|
@@ -265,7 +265,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
265
265
|
configBuilder.locale(Locale.forLanguageTag(configuration.getString(KEY_LOCALE)));
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
Intent intent =
|
|
268
|
+
Intent intent = Sdk.createLaunchIntent(activity, startUrl, configBuilder.build());
|
|
269
269
|
activity.startActivityForResult(intent, VERIFF_REQUEST_CODE);
|
|
270
270
|
|
|
271
271
|
} catch (Throwable t) {
|
|
@@ -274,7 +274,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
private void handleLogo(Context context, String key,
|
|
277
|
+
private void handleLogo(Context context, String key, Branding.Builder branding, ReadableMap brandConfig) {
|
|
278
278
|
ReadableType type = brandConfig.getType(key);
|
|
279
279
|
if (ReadableType.String.equals(type)) {
|
|
280
280
|
branding.toolbarIcon(getDrawableId(context, brandConfig.getString(key)));
|
|
@@ -335,7 +335,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
|
|
|
335
335
|
return context.getResources().getIdentifier(name, "drawable", context.getPackageName());
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
private static String codeToError(
|
|
338
|
+
private static String codeToError(Result.Error error) {
|
|
339
339
|
switch (error) {
|
|
340
340
|
case UNABLE_TO_ACCESS_CAMERA:
|
|
341
341
|
return ERROR_UNABLE_TO_ACCESS_CAMERA;
|