Skip to content

Commit f6d7b67

Browse files
Release 5.2.0
1 parent ea83ceb commit f6d7b67

File tree

8 files changed

+79
-53
lines changed

8 files changed

+79
-53
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# iProov Biometrics Flutter SDK
22

3+
## 5.2.0
4+
5+
iProov Biometrics Flutter SDK v5.2.0 includes the following changes
6+
7+
### iOS
8+
9+
* Upgraded SDK to [v12.4.1](https://github.com/iProov/ios/releases/tag/12.4.1).
10+
11+
### Android
12+
13+
* Upgraded SDK to [v10.3.2](https://github.com/iProov/android/releases/tag/v10.3.2).
14+
15+
316
## 5.1.0
417

518
iProov Biometrics Flutter SDK v5.1.0 includes the following changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Add the following to your project's `pubspec.yaml` file:
3535

3636
```yaml
3737
dependencies:
38-
iproov_flutter: ^5.1.0
38+
iproov_flutter: ^5.2.0
3939
```
4040
4141
You can then install it with:

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.iproov.flutter_sdk_plugin'
2-
version '5.1.0'
2+
version '5.2.0'
33

44
buildscript {
55
ext.kotlin_version = '1.5.30'
@@ -49,5 +49,5 @@ android {
4949

5050
dependencies {
5151
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
52-
implementation "com.iproov.sdk:iproov:10.3.0"
52+
implementation "com.iproov.sdk:iproov:10.3.2"
5353
}

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- iProov (12.3.0)
4-
- iproov_flutter (5.1.0):
3+
- iProov (12.4.1)
4+
- iproov_flutter (5.2.0):
55
- Flutter
6-
- iProov (= 12.3.0)
6+
- iProov (= 12.4.1)
77

88
DEPENDENCIES:
99
- Flutter (from `Flutter`)
@@ -21,9 +21,9 @@ EXTERNAL SOURCES:
2121

2222
SPEC CHECKSUMS:
2323
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
24-
iProov: 15d820ec17fe833a1d5d4c9a046f68a0aea7fe4c
25-
iproov_flutter: e00c5eb71524c717f26f436fdea9e21a54e13b74
24+
iProov: 7998aec7000e95cdfa514d65f4c6f33773606a76
25+
iproov_flutter: 7010c5e2d0997e1221809d345f4163b6c3d90826
2626

2727
PODFILE CHECKSUM: 61e432a29a6cfb9fc7ca7cacd9dce49cb7fb3466
2828

29-
COCOAPODS: 1.15.2
29+
COCOAPODS: 1.16.2

ios/Classes/SwiftIProovSDKPlugin.swift

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ private enum EventName: String {
3131
}
3232

3333
public final class SwiftIProovSDKPlugin: NSObject {
34-
34+
3535
private enum PluginError: LocalizedError {
3636
case invalidArguments
3737
case invalidStreamingURL
3838
case invalidToken
3939
case invalidOptions
40-
40+
4141
var errorDescription: String? {
4242
switch self {
4343
case .invalidArguments:
@@ -51,13 +51,13 @@ public final class SwiftIProovSDKPlugin: NSObject {
5151
}
5252
}
5353
}
54-
54+
5555
private var eventListener: EventListener?
5656
private var uiEventListener: EventListener?
5757
private var session: Session?
5858
private var pendingError: Error? // Ideally this would be IProovError? but it crashes the compiler =/
59-
60-
59+
60+
6161
func registerEventChannel(with registrar: FlutterPluginRegistrar) {
6262
let eventChannel = FlutterEventChannel(name: "com.iproov.sdk.listener", binaryMessenger: registrar.messenger())
6363
eventListener = EventListener(
@@ -68,7 +68,7 @@ public final class SwiftIProovSDKPlugin: NSObject {
6868
eventSink(FlutterEndOfEventStream)
6969
self.pendingError = nil
7070
}
71-
71+
7272
return nil
7373
},
7474
onCancel: {
@@ -79,7 +79,7 @@ public final class SwiftIProovSDKPlugin: NSObject {
7979
)
8080
eventChannel.setStreamHandler(eventListener)
8181
}
82-
82+
8383
func registerUIEventChannel(with registrar: FlutterPluginRegistrar) {
8484
let eventChannel = FlutterEventChannel(name: "com.iproov.sdk.uiListener", binaryMessenger: registrar.messenger())
8585
uiEventListener = EventListener(
@@ -88,35 +88,35 @@ public final class SwiftIProovSDKPlugin: NSObject {
8888
)
8989
eventChannel.setStreamHandler(uiEventListener)
9090
}
91-
91+
9292
func handleLaunch(arguments: Any?) throws -> Session {
9393
guard let arguments = arguments as? [String: String] else {
9494
throw PluginError.invalidArguments
9595
}
96-
96+
9797
guard let streamingURLString = arguments["streamingURL"],
9898
let streamingURL = URL(string: streamingURLString) else {
9999
throw PluginError.invalidStreamingURL
100100
}
101-
101+
102102
guard let token = arguments["token"] else {
103103
throw PluginError.invalidToken
104104
}
105-
105+
106106
let options: Options
107-
107+
108108
if let optionsJSONString = arguments["optionsJSON"] {
109109
guard let dict = try? JSONSerialization.jsonObject(with: optionsJSONString.data(using: .utf8)!, options: []) as? [String: Any] else {
110110
throw PluginError.invalidOptions
111111
}
112-
112+
113113
options = Options.from(flutterJSON: dict)
114114
} else {
115115
options = Options()
116116
}
117-
117+
118118
options.viewDelegate = self
119-
119+
120120
return IProov.launch(streamingURL: streamingURL, token: token, options: options) { [weak self] status in
121121
self?.eventListener?.sendEvent(event: status.serialized)
122122
if status.isFinished {
@@ -130,11 +130,11 @@ extension SwiftIProovSDKPlugin: IProovViewDelegate {
130130
public func willPresentIProovView() {
131131
self.uiEventListener?.sendEvent(event: ["uiEvent" : UIEventName.not_started.rawValue])
132132
}
133-
133+
134134
public func didPresentIProovView() {
135135
self.uiEventListener?.sendEvent(event: ["uiEvent" : UIEventName.started.rawValue])
136136
}
137-
137+
138138
public func didDismissIProovView() {
139139
self.uiEventListener?.sendEvent(event: ["uiEvent" : UIEventName.ended.rawValue])
140140
}
@@ -145,20 +145,21 @@ extension SwiftIProovSDKPlugin: FlutterPlugin {
145145
let channel = FlutterMethodChannel(name: "com.iproov.sdk", binaryMessenger: registrar.messenger())
146146
let instance = SwiftIProovSDKPlugin()
147147
registrar.addMethodCallDelegate(instance, channel: channel)
148-
148+
149149
instance.registerEventChannel(with: registrar)
150150
instance.registerUIEventChannel(with: registrar)
151151
}
152-
152+
153153
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
154154
switch call.method {
155155
case "launch":
156156
do {
157+
setEnvironment()
157158
session = try handleLaunch(arguments: call.arguments)
158159
} catch { // Re-route all launch errors via the event sink, to avoid needing to handle them async on launch
159160
pendingError = IProovError.unexpectedError("Flutter Error: " + error.localizedDescription)
160161
}
161-
162+
162163
result(nil)
163164
case "keyPair.sign":
164165
guard let flutterData = call.arguments as? FlutterStandardTypedData else {
@@ -180,34 +181,39 @@ extension SwiftIProovSDKPlugin: FlutterPlugin {
180181
result(FlutterMethodNotImplemented)
181182
}
182183
}
184+
185+
private func setEnvironment(){
186+
let sharedPrefs = UserDefaults(suiteName: "iproov_environment_prefs")
187+
sharedPrefs?.set("flutter", forKey: "environment")
188+
}
183189
}
184190

185191
class EventListener: NSObject, FlutterStreamHandler {
186192
private var eventSink: FlutterEventSink?
187-
193+
188194
// Closures to capture external behavior
189195
private let onListenHandler: (@escaping FlutterEventSink) -> FlutterError?
190196
private let onCancelHandler: () -> FlutterError?
191-
197+
192198
init(onListen: @escaping (FlutterEventSink) -> FlutterError?, onCancel: @escaping () -> FlutterError?) {
193199
self.onListenHandler = onListen
194200
self.onCancelHandler = onCancel
195201
}
196-
202+
197203
func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
198204
self.eventSink = events
199205
return onListenHandler(events)
200206
}
201-
207+
202208
func onCancel(withArguments arguments: Any?) -> FlutterError? {
203209
self.eventSink = nil
204210
return onCancelHandler()
205211
}
206-
212+
207213
func sendEvent(event: [String : Any]?) {
208214
eventSink?(event)
209215
}
210-
216+
211217
func endOfEventStream() {
212218
eventSink?(FlutterEndOfEventStream)
213219
}
@@ -249,26 +255,26 @@ private extension Status {
249255
return nil
250256
}
251257
}
252-
258+
253259
}
254260

255261
private extension Options {
256-
262+
257263
// Handle any Flutter-specific requirements, e.g. custom fonts
258264
static func from(flutterJSON dict: [String : Any]) -> Options {
259-
265+
260266
let options = Options.from(dictionary: dict)
261-
267+
262268
// Handle custom fonts:
263269
if let fontPath = dict["font"] as? String {
264270
installFont(path: fontPath)
265271
let fontName = String(fontPath.split(separator: "/").last!.split(separator: ".").first!)
266272
options.font = fontName
267273
}
268-
274+
269275
return options
270276
}
271-
277+
272278
// Load font from Flutter assets:
273279
private static func installFont(path: String) {
274280
let fontKey = FlutterDartProject.lookupKey(forAsset: path)
@@ -277,22 +283,22 @@ private extension Options {
277283
let dataProvider = CGDataProvider(data: fontData as CFData) else {
278284
fatalError("Failed to load font at path: \(path)")
279285
}
280-
286+
281287
let fontRef = CGFont(dataProvider)
282288
CTFontManagerRegisterGraphicsFont(fontRef!, nil)
283289
}
284290
}
285291

286292
private extension Data {
287-
293+
288294
var flutterData: FlutterStandardTypedData? {
289295
FlutterStandardTypedData(bytes: self)
290296
}
291-
297+
292298
}
293299

294300
private extension IProovError {
295-
301+
296302
var serialized: [String: String?] {
297303
var result = [String: String?]()
298304
result[EventKey.event.rawValue] = "error"
@@ -301,7 +307,7 @@ private extension IProovError {
301307
result[EventKey.message.rawValue] = localizedMessage
302308
return result
303309
}
304-
310+
305311
private var errorName: String {
306312
switch self {
307313
case .captureAlreadyActive:
@@ -322,7 +328,7 @@ private extension IProovError {
322328
return "unexpected_error"
323329
}
324330
}
325-
331+
326332
}
327333

328334
private extension Canceler {

ios/iproov_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
1414
s.source_files = 'Classes/**/*'
1515

1616
s.dependency 'Flutter'
17-
s.dependency 'iProov', '12.3.0'
17+
s.dependency 'iProov', '12.4.1'
1818

1919
s.swift_version = '5.5'
2020
s.platform = :ios, '13.0'

iproov_api_client/lib/validation_result.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@ class ValidationResult {
66
final bool isPassed;
77
final String token;
88
final Image? image;
9+
final Image? jpegImage;
910
final String? failureReason;
11+
final Map<String, dynamic>? signals;
1012

1113
const ValidationResult({
1214
required this.isPassed,
1315
required this.token,
1416
required this.image,
17+
required this.jpegImage,
1518
required this.failureReason,
19+
required this.signals,
1620
});
1721

1822
factory ValidationResult.fromJson(Map<String, dynamic> json) => ValidationResult(
19-
isPassed: json['passed'],
20-
token: json['token'],
21-
image: _imageFromBase64(json['frame']),
22-
failureReason: json['result']?['reason']);
23+
isPassed: json['passed'],
24+
token: json['token'],
25+
image: _imageFromBase64(json['frame']),
26+
jpegImage: _imageFromBase64(json['frame_jpeg']),
27+
failureReason: json['result']?['reason'],
28+
signals: json['signals'],
29+
);
2330

2431
static Image? _imageFromBase64(String? value) => (value == null) ? null : decodeImage(base64Decode(value));
2532
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: iproov_flutter
22
description: The iProov Biometrics SDK for Flutter, providing flexible authentication for identity assurance
3-
version: 5.1.0
3+
version: 5.2.0
44
homepage: https://github.com/iProov/flutter
55

66
environment:

0 commit comments

Comments
 (0)