Commit 39ba55a2 authored by Javokhir's avatar Javokhir
Browse files

1.2.2 version

parent 977ea194
## 1.2.2
* 🔥 Added new ability to customize the organization logo used in the SDK flow.
## 1.2.1 ## 1.2.1
* 🔥 Added new ability to customize the organization logo used in the SDK flow. * 🔥 Added new ability to customize the organization logo used in the SDK flow.
......
...@@ -97,8 +97,7 @@ sdk detects a blurry photo. ...@@ -97,8 +97,7 @@ sdk detects a blurry photo.
- **AUTH** is used to identify the user through the MyID services. - **AUTH** is used to identify the user through the MyID services.
- **FACE** is used to detect a face and returns a picture (bitmap). - **FACE** is used to detect a face and returns a picture (bitmap).
**Note 1.6.** `MyIdCameraShape` contains **[CIRCLE](images/screen03.jpg)** **Note 1.6.** `MyIdCameraShape` contains **[CIRCLE](images/screen03.jpg)** and **[ELLIPSE](images/screen04.jpg)** types.
and **[ELLIPSE](images/screen04.jpg)** types.
## Theme ## Theme
...@@ -120,8 +119,6 @@ For **iOS** theme config use `MyIdIOSAppearance` class and its properties. ...@@ -120,8 +119,6 @@ For **iOS** theme config use `MyIdIOSAppearance` class and its properties.
* `buttonCornerRadius`: Defines the radius dimension of all the corners of primary buttons * `buttonCornerRadius`: Defines the radius dimension of all the corners of primary buttons
* `logo`: String, that will be displayed on the input screen. If you would like to display your own logo on the top of the screen, this is the place to provide it.
## SDK error codes ## SDK error codes
The error code in the following list may appear during the call of SDK. The list below is for your The error code in the following list may appear during the call of SDK. The list below is for your
......
...@@ -117,8 +117,15 @@ class MyIdSdk( ...@@ -117,8 +117,15 @@ class MyIdSdk(
} }
val orgMap = config["organizationDetails"] as? HashMap<String, Any?> val orgMap = config["organizationDetails"] as? HashMap<String, Any?>
val drawableName = orgMap?.fetch("logo")
val packageName = currentActivity?.packageName
val resources = currentActivity?.resources
val drawableId = resources?.getIdentifier(drawableName, "drawable", packageName)
organizationDetails = MyIdOrganizationDetails( organizationDetails = MyIdOrganizationDetails(
phoneNumber = orgMap?.fetch("phone") phoneNumber = orgMap?.fetch("phone"),
logo = drawableId,
) )
} catch (e: Exception) { } catch (e: Exception) {
currentFlutterResult?.error( currentFlutterResult?.error(
......
...@@ -36,6 +36,11 @@ class _MyAppState extends State<MyApp> { ...@@ -36,6 +36,11 @@ class _MyAppState extends State<MyApp> {
clientHash: clientHash, clientHash: clientHash,
clientHashId: clientHashId, clientHashId: clientHashId,
buildMode: MyIdBuildMode.PRODUCTION, buildMode: MyIdBuildMode.PRODUCTION,
entryType: MyIdEntryType.AUTH,
organizationDetails: const MyIdOrganizationDetails(
phone: "phone",
logo: "logo1",
)
), ),
iosAppearance: const MyIdIOSAppearance() iosAppearance: const MyIdIOSAppearance()
); );
......
...@@ -121,7 +121,7 @@ packages: ...@@ -121,7 +121,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "1.2.0" version: "1.2.2"
path: path:
dependency: transitive dependency: transitive
description: description:
......
...@@ -10,7 +10,6 @@ public class AppearancePublic: NSObject { ...@@ -10,7 +10,6 @@ public class AppearancePublic: NSObject {
public let primaryButtonTextColor: UIColor? public let primaryButtonTextColor: UIColor?
public let primaryButtonTextColorDisabled: UIColor? public let primaryButtonTextColorDisabled: UIColor?
public let buttonCornerRadius: Int? public let buttonCornerRadius: Int?
public let logo: UIImage?
public init( public init(
primaryColor: UIColor?, primaryColor: UIColor?,
...@@ -19,8 +18,7 @@ public class AppearancePublic: NSObject { ...@@ -19,8 +18,7 @@ public class AppearancePublic: NSObject {
primaryButtonColorDisabled: UIColor?, primaryButtonColorDisabled: UIColor?,
primaryButtonTextColor: UIColor?, primaryButtonTextColor: UIColor?,
primaryButtonTextColorDisabled: UIColor?, primaryButtonTextColorDisabled: UIColor?,
buttonCornerRadius: Int?, buttonCornerRadius: Int?
logo: UIImage?
) { ) {
self.primaryColor = primaryColor self.primaryColor = primaryColor
self.errorColor = errorColor self.errorColor = errorColor
...@@ -29,7 +27,6 @@ public class AppearancePublic: NSObject { ...@@ -29,7 +27,6 @@ public class AppearancePublic: NSObject {
self.primaryButtonTextColor = primaryButtonTextColor self.primaryButtonTextColor = primaryButtonTextColor
self.primaryButtonTextColorDisabled = primaryButtonTextColorDisabled self.primaryButtonTextColorDisabled = primaryButtonTextColorDisabled
self.buttonCornerRadius = buttonCornerRadius self.buttonCornerRadius = buttonCornerRadius
self.logo = logo
} }
} }
...@@ -55,9 +52,6 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? { ...@@ -55,9 +52,6 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? {
let buttonCornerRadius: Int? = (jsonResult["buttonCornerRadius"] == nil) ? nil : 8 let buttonCornerRadius: Int? = (jsonResult["buttonCornerRadius"] == nil) ? nil : 8
let logo = (jsonResult["logo"] == nil)
? nil : UIImage(named: jsonResult["logo"] as! String)
let appearancePublic = AppearancePublic( let appearancePublic = AppearancePublic(
primaryColor: primaryColor, primaryColor: primaryColor,
errorColor: errorColor, errorColor: errorColor,
...@@ -65,8 +59,7 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? { ...@@ -65,8 +59,7 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? {
primaryButtonColorDisabled: primaryButtonColorDisabled, primaryButtonColorDisabled: primaryButtonColorDisabled,
primaryButtonTextColor: primaryButtonTextColor, primaryButtonTextColor: primaryButtonTextColor,
primaryButtonTextColorDisabled: primaryButtonTextColorDisabled, primaryButtonTextColorDisabled: primaryButtonTextColorDisabled,
buttonCornerRadius: buttonCornerRadius, buttonCornerRadius: buttonCornerRadius
logo: logo
) )
return appearancePublic return appearancePublic
} else { } else {
...@@ -161,9 +154,11 @@ public func buildMyIdConfig( ...@@ -161,9 +154,11 @@ public func buildMyIdConfig(
let withPhoto = config["withPhoto"] as? Bool ?? false let withPhoto = config["withPhoto"] as? Bool ?? false
let organizationDetailsDict = config["organizationDetails"] as? NSDictionary let organizationDetailsDict = config["organizationDetails"] as? NSDictionary
let logo = (organizationDetailsDict?["logo"] == nil) ? nil : UIImage(named: organizationDetailsDict?["logo"] as! String)
let organizationDetails = MyIdOrganizationDetails() let organizationDetails = MyIdOrganizationDetails()
organizationDetails.phoneNumber = organizationDetailsDict?["phone"] as? String ?? "" organizationDetails.phoneNumber = organizationDetailsDict?["phone"] as? String ?? ""
organizationDetails.logo = appearancePublic?.logo organizationDetails.logo = logo
let config = MyIdConfig() let config = MyIdConfig()
config.clientId = clientId config.clientId = clientId
......
...@@ -68,9 +68,11 @@ class MyIdResult { ...@@ -68,9 +68,11 @@ class MyIdResult {
class MyIdOrganizationDetails { class MyIdOrganizationDetails {
final String? phone; final String? phone;
final String? logo;
const MyIdOrganizationDetails({ const MyIdOrganizationDetails({
required this.phone required this.phone,
required this.logo
}); });
factory MyIdOrganizationDetails.fromJson(Map<String, dynamic> json) => factory MyIdOrganizationDetails.fromJson(Map<String, dynamic> json) =>
...@@ -87,7 +89,6 @@ class MyIdIOSAppearance { ...@@ -87,7 +89,6 @@ class MyIdIOSAppearance {
final String? primaryButtonTextColor; final String? primaryButtonTextColor;
final String? primaryButtonTextColorDisabled; final String? primaryButtonTextColorDisabled;
final int? buttonCornerRadius; final int? buttonCornerRadius;
final String? logo;
const MyIdIOSAppearance({ const MyIdIOSAppearance({
this.primaryColor, this.primaryColor,
...@@ -97,7 +98,6 @@ class MyIdIOSAppearance { ...@@ -97,7 +98,6 @@ class MyIdIOSAppearance {
this.primaryButtonTextColor, this.primaryButtonTextColor,
this.primaryButtonTextColorDisabled, this.primaryButtonTextColorDisabled,
this.buttonCornerRadius, this.buttonCornerRadius,
this.logo,
}); });
factory MyIdIOSAppearance.fromJson(Map<String, dynamic> json) => factory MyIdIOSAppearance.fromJson(Map<String, dynamic> json) =>
......
...@@ -79,12 +79,14 @@ Map<String, dynamic> _$MyIdOrganizationDetailsToJson(MyIdOrganizationDetails ins ...@@ -79,12 +79,14 @@ Map<String, dynamic> _$MyIdOrganizationDetailsToJson(MyIdOrganizationDetails ins
} }
writeNotNull('phone', instance.phone); writeNotNull('phone', instance.phone);
writeNotNull('logo', instance.logo);
return val; return val;
} }
MyIdOrganizationDetails _$MyIdOrganizationDetailsFromJson(Map<String, dynamic> json) { MyIdOrganizationDetails _$MyIdOrganizationDetailsFromJson(Map<String, dynamic> json) {
return MyIdOrganizationDetails( return MyIdOrganizationDetails(
phone: json['phone'] as String?, phone: json['phone'] as String?,
logo: json['logo'] as String?,
); );
} }
...@@ -103,7 +105,6 @@ Map<String, dynamic> _$MyIdIOSAppearanceToJson(MyIdIOSAppearance instance) { ...@@ -103,7 +105,6 @@ Map<String, dynamic> _$MyIdIOSAppearanceToJson(MyIdIOSAppearance instance) {
writeNotNull('primaryButtonColorDisabled', instance.primaryButtonColorDisabled); writeNotNull('primaryButtonColorDisabled', instance.primaryButtonColorDisabled);
writeNotNull('primaryButtonTextColorDisabled', instance.primaryButtonTextColorDisabled); writeNotNull('primaryButtonTextColorDisabled', instance.primaryButtonTextColorDisabled);
writeNotNull('buttonCornerRadius', instance.buttonCornerRadius); writeNotNull('buttonCornerRadius', instance.buttonCornerRadius);
writeNotNull('logo', instance.logo);
return val; return val;
} }
...@@ -114,8 +115,7 @@ MyIdIOSAppearance _$MyIdIOSAppearanceFromJson(Map<String, dynamic> json) { ...@@ -114,8 +115,7 @@ MyIdIOSAppearance _$MyIdIOSAppearanceFromJson(Map<String, dynamic> json) {
primaryButtonColor: json['primaryButtonColor'] as String?, primaryButtonColor: json['primaryButtonColor'] as String?,
primaryButtonColorDisabled: json['primaryButtonColorDisabled'] as String?, primaryButtonColorDisabled: json['primaryButtonColorDisabled'] as String?,
primaryButtonTextColorDisabled: json['primaryButtonTextColorDisabled'] as String?, primaryButtonTextColorDisabled: json['primaryButtonTextColorDisabled'] as String?,
buttonCornerRadius: json['buttonCornerRadius'] as int?, buttonCornerRadius: json['buttonCornerRadius'] as int?
logo: json['logo'] as String?,
); );
} }
......
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.2.1 version: 1.2.2
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