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
* 🔥 Added new ability to customize the organization logo used in the SDK flow.
......
......@@ -97,8 +97,7 @@ sdk detects a blurry photo.
- **AUTH** is used to identify the user through the MyID services.
- **FACE** is used to detect a face and returns a picture (bitmap).
**Note 1.6.** `MyIdCameraShape` contains **[CIRCLE](images/screen03.jpg)**
and **[ELLIPSE](images/screen04.jpg)** types.
**Note 1.6.** `MyIdCameraShape` contains **[CIRCLE](images/screen03.jpg)** and **[ELLIPSE](images/screen04.jpg)** types.
## Theme
......@@ -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
* `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
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(
}
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(
phoneNumber = orgMap?.fetch("phone")
phoneNumber = orgMap?.fetch("phone"),
logo = drawableId,
)
} catch (e: Exception) {
currentFlutterResult?.error(
......
......@@ -36,6 +36,11 @@ class _MyAppState extends State<MyApp> {
clientHash: clientHash,
clientHashId: clientHashId,
buildMode: MyIdBuildMode.PRODUCTION,
entryType: MyIdEntryType.AUTH,
organizationDetails: const MyIdOrganizationDetails(
phone: "phone",
logo: "logo1",
)
),
iosAppearance: const MyIdIOSAppearance()
);
......
......@@ -121,7 +121,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.0"
version: "1.2.2"
path:
dependency: transitive
description:
......
......@@ -10,7 +10,6 @@ public class AppearancePublic: NSObject {
public let primaryButtonTextColor: UIColor?
public let primaryButtonTextColorDisabled: UIColor?
public let buttonCornerRadius: Int?
public let logo: UIImage?
public init(
primaryColor: UIColor?,
......@@ -19,8 +18,7 @@ public class AppearancePublic: NSObject {
primaryButtonColorDisabled: UIColor?,
primaryButtonTextColor: UIColor?,
primaryButtonTextColorDisabled: UIColor?,
buttonCornerRadius: Int?,
logo: UIImage?
buttonCornerRadius: Int?
) {
self.primaryColor = primaryColor
self.errorColor = errorColor
......@@ -29,7 +27,6 @@ public class AppearancePublic: NSObject {
self.primaryButtonTextColor = primaryButtonTextColor
self.primaryButtonTextColorDisabled = primaryButtonTextColorDisabled
self.buttonCornerRadius = buttonCornerRadius
self.logo = logo
}
}
......@@ -54,9 +51,6 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? {
? nil : UIColor.from(hex: jsonResult["primaryButtonTextColorDisabled"] as! String)
let buttonCornerRadius: Int? = (jsonResult["buttonCornerRadius"] == nil) ? nil : 8
let logo = (jsonResult["logo"] == nil)
? nil : UIImage(named: jsonResult["logo"] as! String)
let appearancePublic = AppearancePublic(
primaryColor: primaryColor,
......@@ -65,8 +59,7 @@ public func loadAppearance(config: NSDictionary) throws -> AppearancePublic? {
primaryButtonColorDisabled: primaryButtonColorDisabled,
primaryButtonTextColor: primaryButtonTextColor,
primaryButtonTextColorDisabled: primaryButtonTextColorDisabled,
buttonCornerRadius: buttonCornerRadius,
logo: logo
buttonCornerRadius: buttonCornerRadius
)
return appearancePublic
} else {
......@@ -161,9 +154,11 @@ public func buildMyIdConfig(
let withPhoto = config["withPhoto"] as? Bool ?? false
let organizationDetailsDict = config["organizationDetails"] as? NSDictionary
let logo = (organizationDetailsDict?["logo"] == nil) ? nil : UIImage(named: organizationDetailsDict?["logo"] as! String)
let organizationDetails = MyIdOrganizationDetails()
organizationDetails.phoneNumber = organizationDetailsDict?["phone"] as? String ?? ""
organizationDetails.logo = appearancePublic?.logo
organizationDetails.logo = logo
let config = MyIdConfig()
config.clientId = clientId
......
......@@ -68,9 +68,11 @@ class MyIdResult {
class MyIdOrganizationDetails {
final String? phone;
final String? logo;
const MyIdOrganizationDetails({
required this.phone
required this.phone,
required this.logo
});
factory MyIdOrganizationDetails.fromJson(Map<String, dynamic> json) =>
......@@ -87,7 +89,6 @@ class MyIdIOSAppearance {
final String? primaryButtonTextColor;
final String? primaryButtonTextColorDisabled;
final int? buttonCornerRadius;
final String? logo;
const MyIdIOSAppearance({
this.primaryColor,
......@@ -97,7 +98,6 @@ class MyIdIOSAppearance {
this.primaryButtonTextColor,
this.primaryButtonTextColorDisabled,
this.buttonCornerRadius,
this.logo,
});
factory MyIdIOSAppearance.fromJson(Map<String, dynamic> json) =>
......
......@@ -79,12 +79,14 @@ Map<String, dynamic> _$MyIdOrganizationDetailsToJson(MyIdOrganizationDetails ins
}
writeNotNull('phone', instance.phone);
writeNotNull('logo', instance.logo);
return val;
}
MyIdOrganizationDetails _$MyIdOrganizationDetailsFromJson(Map<String, dynamic> json) {
return MyIdOrganizationDetails(
phone: json['phone'] as String?,
logo: json['logo'] as String?,
);
}
......@@ -103,7 +105,6 @@ Map<String, dynamic> _$MyIdIOSAppearanceToJson(MyIdIOSAppearance instance) {
writeNotNull('primaryButtonColorDisabled', instance.primaryButtonColorDisabled);
writeNotNull('primaryButtonTextColorDisabled', instance.primaryButtonTextColorDisabled);
writeNotNull('buttonCornerRadius', instance.buttonCornerRadius);
writeNotNull('logo', instance.logo);
return val;
}
......@@ -114,8 +115,7 @@ MyIdIOSAppearance _$MyIdIOSAppearanceFromJson(Map<String, dynamic> json) {
primaryButtonColor: json['primaryButtonColor'] as String?,
primaryButtonColorDisabled: json['primaryButtonColorDisabled'] as String?,
primaryButtonTextColorDisabled: json['primaryButtonTextColorDisabled'] as String?,
buttonCornerRadius: json['buttonCornerRadius'] as int?,
logo: json['logo'] as String?,
buttonCornerRadius: json['buttonCornerRadius'] as int?
);
}
......
name: myid
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
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