@veriff/react-native-sdk 2.3.1 → 2.5.1

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.
File without changes
@@ -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.+'
81
+ implementation 'com.veriff:veriff-library:3.21.+'
82
82
  }
83
83
 
84
84
  def configureReactNativePom(def pom) {
@@ -90,12 +90,12 @@ def configureReactNativePom(def pom) {
90
90
  version = packageJson.version
91
91
  group = "com.reactlibrary"
92
92
  description packageJson.description
93
- url packageJson.repository.baseUrl
93
+ url = "https://github.com/veriff/react-native-sdk"
94
94
 
95
95
  licenses {
96
96
  license {
97
97
  name packageJson.license
98
- url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
98
+ url "https://github.com/veriff/react-native-sdk" + '/blob/master/' + packageJson.licenseFilename
99
99
  distribution 'repo'
100
100
  }
101
101
  }
@@ -83,6 +83,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
83
83
  public static final String KEY_STATUS_BAR_COLOR = "statusBarColor";
84
84
  public static final String KEY_PRIMARY_TEXT_COLOR = "primaryTextColor";
85
85
  public static final String KEY_SECONDARY_TEXT_COLOR = "secondaryTextColor";
86
+ public static final String KEY_PRIMARY_BUTTON_BACKGROUND_COLOR = "primaryButtonBackgroundColor";
86
87
  public static final String KEY_BUTTON_CORNER_RADIUS = "buttonCornerRadius";
87
88
  private static final String KEY_CUSTOM_INTRO_SCREEN = "customIntroScreen";
88
89
  private static final String KEY_RN_IMAGE_URI = "uri";
@@ -250,6 +251,9 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
250
251
  if (brandConfig.hasKey(KEY_SECONDARY_TEXT_COLOR)) {
251
252
  branding.secondaryTextColor(parseColor(brandConfig.getString(KEY_SECONDARY_TEXT_COLOR)));
252
253
  }
254
+ if (brandConfig.hasKey(KEY_PRIMARY_BUTTON_BACKGROUND_COLOR)) {
255
+ branding.primaryButtonBackgroundColor(parseColor(brandConfig.getString(KEY_PRIMARY_BUTTON_BACKGROUND_COLOR)));
256
+ }
253
257
  if (brandConfig.hasKey(KEY_BUTTON_CORNER_RADIUS)) {
254
258
  branding.buttonCornerRadius((float)brandConfig.getDouble(KEY_BUTTON_CORNER_RADIUS));
255
259
  }
package/ios/VeriffSdk.m CHANGED
@@ -1,6 +1,6 @@
1
1
  #import <React/RCTBridgeModule.h>
2
2
 
3
- @interface RCT_EXTERN_MODULE(VeriffSdk, NSObject)
3
+ @interface RCT_EXTERN_REMAP_MODULE(VeriffSdk, VeriffSdkReactWrapper, NSObject)
4
4
 
5
5
  RCT_EXTERN_METHOD(launchVeriff:(NSDictionary *)configuration resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
6
6
 
@@ -2,7 +2,7 @@ import Foundation
2
2
  import Veriff
3
3
  import UIKit
4
4
 
5
- @objc(VeriffSdk)
5
+ @objc(VeriffSdkReactWrapper)
6
6
  class VeriffSdk: NSObject {
7
7
  /**
8
8
  * Indicates that the parameters passed to |launchVeriff([String: AnyObject]], RCTPromiseResolveBlock,RCTPromiseRejectBlock| were invalid.
@@ -34,6 +34,7 @@ class VeriffSdk: NSObject {
34
34
  private static let STATUS_BAR_COLOR = "statusBarColor"
35
35
  private static let PRIMARY_TEXT_COLOR = "primaryTextColor"
36
36
  private static let SECONDARY_TEXT_COLOR = "secondaryTextColor"
37
+ private static let PRIMARY_BUTTON_BACKGROUND_COLOR = "primaryButtonBackgroundColor"
37
38
  private static let BUTTON_CORNER_RADIUS = "buttonCornerRadius"
38
39
  private static let USE_CUSTOM_INTRO_SCREEN = "customIntroScreen"
39
40
 
@@ -94,6 +95,7 @@ class VeriffSdk: NSObject {
94
95
  branding?.statusBarColor = (brandingConfig[VeriffSdk.STATUS_BAR_COLOR] as? String).map { VeriffSdk.parseColor(hexcolor: $0) }
95
96
  branding?.primaryTextColor = (brandingConfig[VeriffSdk.PRIMARY_TEXT_COLOR] as? String).map { VeriffSdk.parseColor(hexcolor: $0) }
96
97
  branding?.secondaryTextColor = (brandingConfig[VeriffSdk.SECONDARY_TEXT_COLOR] as? String).map { VeriffSdk.parseColor(hexcolor: $0) }
98
+ branding?.primaryButtonBackgroundColor = (brandingConfig[VeriffSdk.PRIMARY_BUTTON_BACKGROUND_COLOR] as? String).map { VeriffSdk.parseColor(hexcolor: $0) }
97
99
  branding?.buttonCornerRadius = (brandingConfig[VeriffSdk.BUTTON_CORNER_RADIUS] as? Double).map { CGFloat($0) }
98
100
  }
99
101
 
@@ -126,6 +128,7 @@ class VeriffSdk: NSObject {
126
128
 
127
129
  let veriff = Veriff.VeriffSdk.shared
128
130
  veriff.delegate = self
131
+ veriff.implementationType = .reactNative
129
132
  veriffConfiguration?.queryItems = VeriffSdk.updateConfigWithQueryItems(urlString: sessionUrl!)
130
133
  veriff.startAuthentication(sessionUrl: sessionUrl!, configuration: veriffConfiguration)
131
134
  }
@@ -0,0 +1,129 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0940"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "NO"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
18
+ BuildableName = "libReact.a"
19
+ BlueprintName = "React-tvOS"
20
+ ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ <BuildActionEntry
24
+ buildForTesting = "YES"
25
+ buildForRunning = "YES"
26
+ buildForProfiling = "YES"
27
+ buildForArchiving = "YES"
28
+ buildForAnalyzing = "YES">
29
+ <BuildableReference
30
+ BuildableIdentifier = "primary"
31
+ BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
32
+ BuildableName = "VeriffSdk-tvOS.app"
33
+ BlueprintName = "VeriffSdk-tvOS"
34
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
35
+ </BuildableReference>
36
+ </BuildActionEntry>
37
+ <BuildActionEntry
38
+ buildForTesting = "YES"
39
+ buildForRunning = "YES"
40
+ buildForProfiling = "NO"
41
+ buildForArchiving = "NO"
42
+ buildForAnalyzing = "YES">
43
+ <BuildableReference
44
+ BuildableIdentifier = "primary"
45
+ BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
46
+ BuildableName = "VeriffSdk-tvOSTests.xctest"
47
+ BlueprintName = "VeriffSdk-tvOSTests"
48
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
49
+ </BuildableReference>
50
+ </BuildActionEntry>
51
+ </BuildActionEntries>
52
+ </BuildAction>
53
+ <TestAction
54
+ buildConfiguration = "Debug"
55
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57
+ shouldUseLaunchSchemeArgsEnv = "YES">
58
+ <Testables>
59
+ <TestableReference
60
+ skipped = "NO">
61
+ <BuildableReference
62
+ BuildableIdentifier = "primary"
63
+ BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
64
+ BuildableName = "VeriffSdk-tvOSTests.xctest"
65
+ BlueprintName = "VeriffSdk-tvOSTests"
66
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
67
+ </BuildableReference>
68
+ </TestableReference>
69
+ </Testables>
70
+ <MacroExpansion>
71
+ <BuildableReference
72
+ BuildableIdentifier = "primary"
73
+ BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
74
+ BuildableName = "VeriffSdk-tvOS.app"
75
+ BlueprintName = "VeriffSdk-tvOS"
76
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
77
+ </BuildableReference>
78
+ </MacroExpansion>
79
+ <AdditionalOptions>
80
+ </AdditionalOptions>
81
+ </TestAction>
82
+ <LaunchAction
83
+ buildConfiguration = "Debug"
84
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
85
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
86
+ launchStyle = "0"
87
+ useCustomWorkingDirectory = "NO"
88
+ ignoresPersistentStateOnLaunch = "NO"
89
+ debugDocumentVersioning = "YES"
90
+ debugServiceExtension = "internal"
91
+ allowLocationSimulation = "YES">
92
+ <BuildableProductRunnable
93
+ runnableDebuggingMode = "0">
94
+ <BuildableReference
95
+ BuildableIdentifier = "primary"
96
+ BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
97
+ BuildableName = "VeriffSdk-tvOS.app"
98
+ BlueprintName = "VeriffSdk-tvOS"
99
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
100
+ </BuildableReference>
101
+ </BuildableProductRunnable>
102
+ <AdditionalOptions>
103
+ </AdditionalOptions>
104
+ </LaunchAction>
105
+ <ProfileAction
106
+ buildConfiguration = "Release"
107
+ shouldUseLaunchSchemeArgsEnv = "YES"
108
+ savedToolIdentifier = ""
109
+ useCustomWorkingDirectory = "NO"
110
+ debugDocumentVersioning = "YES">
111
+ <BuildableProductRunnable
112
+ runnableDebuggingMode = "0">
113
+ <BuildableReference
114
+ BuildableIdentifier = "primary"
115
+ BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
116
+ BuildableName = "VeriffSdk-tvOS.app"
117
+ BlueprintName = "VeriffSdk-tvOS"
118
+ ReferencedContainer = "container:VeriffSdk.xcodeproj">
119
+ </BuildableReference>
120
+ </BuildableProductRunnable>
121
+ </ProfileAction>
122
+ <AnalyzeAction
123
+ buildConfiguration = "Debug">
124
+ </AnalyzeAction>
125
+ <ArchiveAction
126
+ buildConfiguration = "Release"
127
+ revealArchiveInOrganizer = "YES">
128
+ </ArchiveAction>
129
+ </Scheme>
@@ -0,0 +1,56 @@
1
+ import Foundation
2
+ import Veriff
3
+ import UIKit.UIImage
4
+
5
+ @objc(VeriffSdkImageProvider)
6
+ final class VeriffSdkImageProvider: NSObject {
7
+ private let configuration: [String: AnyObject]
8
+
9
+ init(configuration: [String: AnyObject]) {
10
+ self.configuration = configuration
11
+ super.init()
12
+ }
13
+
14
+ func loadLocalAsset() -> UIImage? {
15
+ if let imageURI = configuration[VeriffSdk.LOGO] {
16
+ if let imageDict = imageURI as? [String: AnyObject],
17
+ let urlString = imageDict["uri"] as? String {
18
+ if let url = URL(string: urlString),
19
+ url.isFileURL {
20
+ return UIImage(contentsOfFile: url.path)
21
+ } else {
22
+ return UIImage(named: urlString)
23
+ }
24
+ } else {
25
+ let imageKey = imageURI as! String
26
+ return UIImage(named: imageKey)
27
+ }
28
+ } else {
29
+ let imageKey = configuration[VeriffSdk.NAVIGATION_BAR_IMAGE]
30
+ let image = (imageKey as? String).flatMap { UIImage(named: $0) }
31
+ return image
32
+ }
33
+ }
34
+
35
+ func loadRemoteAsset(url: URL, completion: @escaping (UIImage?) -> Void) {
36
+ if url.isFileURL {
37
+ guard let image = UIImage(contentsOfFile: url.path) else {
38
+ completion(nil)
39
+ return
40
+ }
41
+ completion(image)
42
+ } else {
43
+ URLSession.shared.dataTask(with: url) { (data, urlResponse, error) in
44
+ guard let data = data,
45
+ let image = UIImage(data: data),
46
+ error == nil else {
47
+ completion(nil)
48
+ return
49
+ }
50
+ DispatchQueue.main.async {
51
+ completion(image)
52
+ }
53
+ }.resume()
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@veriff/react-native-sdk",
3
- "title": "React Native Veriff Sdk",
4
- "version": "2.3.1",
3
+ "title": "React Native Veriff SDK",
4
+ "version": "2.5.1",
5
5
  "description": "React Native SDK for Veriff identity verification",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
8
  "lint": "eslint ."
9
9
  },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/veriff/react-native-sdk.git",
13
- "baseUrl": "https://github.com/veriff/react-native-sdk"
14
- },
10
+ "homepage": "https://developers.veriff.com/#react-native-sdk-integration",
15
11
  "keywords": [
16
12
  "react-native",
17
13
  "veriff",
@@ -20,5 +20,5 @@ Pod::Spec.new do |s|
20
20
  s.requires_arc = true
21
21
 
22
22
  s.dependency "React"
23
- s.dependency "VeriffSDK", "~>4.3"
23
+ s.dependency "VeriffSDK", ">= 4.18.0"
24
24
  end