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
* Upgrade Android SDK to 1.0.7.
......
......@@ -9,7 +9,7 @@ MyID SDK flutter plugin.
- [SDK error codes](#sdk-error-codes)
- [Theme](#theme)
Android SDK: `1.0.7`
Android SDK: `1.1.0`
iOS SDK: `2.2.9`
......
group "uz.uzinfocom.myid"
version "1.1.8"
version "1.1.0"
buildscript {
ext.kotlin_version = "1.7.21"
......@@ -49,5 +49,5 @@ android {
}
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
import uz.myid.android.sdk.capture.model.MyIdGraphicFieldType
import uz.myid.android.sdk.capture.model.MyIdImageFormat
import java.io.ByteArrayOutputStream
import java.io.IOException
class MyIdSdkActivityListener(
private val client: MyIdClient
......@@ -50,11 +49,11 @@ class MyIdSdkActivityListener(
}
}
override fun onError(e: MyIdException) {
override fun onError(exception: MyIdException) {
if (flutterResult != null) {
flutterResult?.error(
"error",
"${e.code} - ${e.message}",
"${exception.code} - ${exception.message}",
null
)
flutterResult = null
......@@ -80,35 +79,21 @@ class MyIdSdkActivityListener(
): String? {
this ?: return null
return try {
Base64.encodeToString(toByteArray(format), Base64.DEFAULT)
} catch (_: Throwable) {
null
}
return Base64.encodeToString(toByteArray(format), Base64.DEFAULT)
}
private fun Bitmap.toByteArray(
format: MyIdImageFormat,
quality: Int = 100
): ByteArray? {
var baos: ByteArrayOutputStream? = null
return try {
val compressFormat = when (format) {
MyIdImageFormat.JPG -> Bitmap.CompressFormat.JPEG
MyIdImageFormat.PNG -> Bitmap.CompressFormat.PNG
}
baos = ByteArrayOutputStream()
compress(compressFormat, quality, baos)
baos.toByteArray()
} finally {
if (baos != null) {
try {
baos.close()
} catch (e: IOException) {
e.printStackTrace()
}
}
ByteArrayOutputStream().use { stream ->
compress(compressFormat, quality, stream)
return stream.toByteArray()
}
}
}
\ No newline at end of file
......@@ -121,7 +121,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.8"
version: "1.2.0"
path:
dependency: transitive
description:
......
name: myid
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
repository: https://pub.dev/packages/myid
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