@veriff/react-native-sdk 2.5.1 → 2.7.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.
@@ -0,0 +1 @@
1
+ @DariaRyazhskikhVeriff @MertCelik @yakovshkolnikovveriff
@@ -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:3.21.+'
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.VeriffBranding;
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 VeriffBranding.DrawableProvider, Parcelable {
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.VeriffBranding;
21
- import com.veriff.VeriffConfiguration;
22
- import com.veriff.VeriffResult;
23
- import com.veriff.VeriffResult.Status;
24
- import com.veriff.VeriffSdk;
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 mobi.lab.veriff.data.VeriffConstants;
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.VeriffResult.Status.CANCELED;
35
- import static com.veriff.VeriffResult.Status.ERROR;
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(VeriffConstants.INTENT_EXTRA_SESSION_URL);
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
- VeriffResult veriffResult = VeriffResult.fromResultIntent(data);
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
- VeriffConfiguration.Builder configBuilder = new VeriffConfiguration.Builder();
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
- VeriffBranding.Builder branding = new VeriffBranding.Builder();
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 = VeriffSdk.createLaunchIntent(activity, startUrl, configBuilder.build());
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, VeriffBranding.Builder branding, ReadableMap brandConfig) {
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(VeriffResult.Error error) {
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;
package/app.plugin.js ADDED
@@ -0,0 +1,33 @@
1
+ const {
2
+ withPlugins,
3
+ createRunOncePlugin,
4
+ withProjectBuildGradle,
5
+ } = require('@expo/config-plugins');
6
+
7
+ const pkg = require('@veriff/react-native-sdk/package.json');
8
+
9
+ function getUpdatedProjectGradle(buildGradle) {
10
+ const insertIndex = buildGradle.indexOf('mavenLocal()');
11
+ const updatedBuildGradle = [
12
+ buildGradle.slice(0, insertIndex),
13
+ 'maven { url "https://cdn.veriff.me/android/" } //veriff\n ',
14
+ buildGradle.slice(insertIndex),
15
+ ].join('');
16
+
17
+ return updatedBuildGradle;
18
+ }
19
+
20
+ function withVeriffProjectGradle(expoConfig) {
21
+ return withProjectBuildGradle(expoConfig, config => {
22
+ config.modResults.contents = getUpdatedProjectGradle(
23
+ config.modResults.contents,
24
+ );
25
+ return config;
26
+ });
27
+ }
28
+
29
+ function withVeriff(expoConfig) {
30
+ return withPlugins(expoConfig, [withVeriffProjectGradle]);
31
+ }
32
+
33
+ exports.default = createRunOncePlugin(withVeriff, pkg.name, pkg.version);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veriff/react-native-sdk",
3
3
  "title": "React Native Veriff SDK",
4
- "version": "2.5.1",
4
+ "version": "2.7.0",
5
5
  "description": "React Native SDK for Veriff identity verification",
6
6
  "main": "index.js",
7
7
  "scripts": {