Commit a15a0baf authored by Javokhir's avatar Javokhir
Browse files

v1.2.0

parent 4ba650d9
## 1.2.0
* 🔨 Resolved CameraX Preview black screen: Addressed an issue causing the CameraX preview to display a black screen on specific devices.
## 1.1.9 ## 1.1.9
* Upgrade Android SDK to 1.0.7. * Upgrade Android SDK to 1.0.7.
......
...@@ -9,7 +9,7 @@ MyID SDK flutter plugin. ...@@ -9,7 +9,7 @@ MyID SDK flutter plugin.
- [SDK error codes](#sdk-error-codes) - [SDK error codes](#sdk-error-codes)
- [Theme](#theme) - [Theme](#theme)
Android SDK: `1.0.7` Android SDK: `1.1.0`
iOS SDK: `2.2.9` iOS SDK: `2.2.9`
......
group "uz.uzinfocom.myid" group "uz.uzinfocom.myid"
version "1.1.8" version "1.1.0"
buildscript { buildscript {
ext.kotlin_version = "1.7.21" ext.kotlin_version = "1.7.21"
...@@ -49,5 +49,5 @@ android { ...@@ -49,5 +49,5 @@ android {
} }
dependencies { dependencies {
implementation("uz.myid.sdk.capture:myid-flutter-capture-sdk:1.0.7") implementation("uz.myid.sdk.capture:myid-flutter-capture-sdk:1.1.0")
} }
\ No newline at end of file
...@@ -12,7 +12,6 @@ import uz.myid.android.sdk.capture.MyIdResultListener ...@@ -12,7 +12,6 @@ import uz.myid.android.sdk.capture.MyIdResultListener
import uz.myid.android.sdk.capture.model.MyIdGraphicFieldType import uz.myid.android.sdk.capture.model.MyIdGraphicFieldType
import uz.myid.android.sdk.capture.model.MyIdImageFormat import uz.myid.android.sdk.capture.model.MyIdImageFormat
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.IOException
class MyIdSdkActivityListener( class MyIdSdkActivityListener(
private val client: MyIdClient private val client: MyIdClient
...@@ -50,11 +49,11 @@ class MyIdSdkActivityListener( ...@@ -50,11 +49,11 @@ class MyIdSdkActivityListener(
} }
} }
override fun onError(e: MyIdException) { override fun onError(exception: MyIdException) {
if (flutterResult != null) { if (flutterResult != null) {
flutterResult?.error( flutterResult?.error(
"error", "error",
"${e.code} - ${e.message}", "${exception.code} - ${exception.message}",
null null
) )
flutterResult = null flutterResult = null
...@@ -80,35 +79,21 @@ class MyIdSdkActivityListener( ...@@ -80,35 +79,21 @@ class MyIdSdkActivityListener(
): String? { ): String? {
this ?: return null this ?: return null
return try { return Base64.encodeToString(toByteArray(format), Base64.DEFAULT)
Base64.encodeToString(toByteArray(format), Base64.DEFAULT)
} catch (_: Throwable) {
null
}
} }
private fun Bitmap.toByteArray( private fun Bitmap.toByteArray(
format: MyIdImageFormat, format: MyIdImageFormat,
quality: Int = 100 quality: Int = 100
): ByteArray? { ): ByteArray? {
var baos: ByteArrayOutputStream? = null val compressFormat = when (format) {
return try { MyIdImageFormat.JPG -> Bitmap.CompressFormat.JPEG
val compressFormat = when (format) { MyIdImageFormat.PNG -> Bitmap.CompressFormat.PNG
MyIdImageFormat.JPG -> Bitmap.CompressFormat.JPEG }
MyIdImageFormat.PNG -> Bitmap.CompressFormat.PNG
}
baos = ByteArrayOutputStream() ByteArrayOutputStream().use { stream ->
compress(compressFormat, quality, baos) compress(compressFormat, quality, stream)
baos.toByteArray() return stream.toByteArray()
} finally {
if (baos != null) {
try {
baos.close()
} catch (e: IOException) {
e.printStackTrace()
}
}
} }
} }
} }
\ No newline at end of file
...@@ -121,7 +121,7 @@ packages: ...@@ -121,7 +121,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "1.1.8" version: "1.2.0"
path: path:
dependency: transitive dependency: transitive
description: description:
......
name: myid name: myid
description: MyID SDK plugin for Flutter. Package supports iOS and Android to verify users identity. description: MyID SDK plugin for Flutter. Package supports iOS and Android to verify users identity.
version: 1.1.9 version: 1.2.0
homepage: https://pub.dev/packages/myid homepage: https://pub.dev/packages/myid
repository: https://pub.dev/packages/myid repository: https://pub.dev/packages/myid
issue_tracker: https://gitlab.myid.uz/myid-public-code/myid-sample-flutter/-/issues issue_tracker: https://gitlab.myid.uz/myid-public-code/myid-sample-flutter/-/issues
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment