Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MYID Public Code
MyID Flutter SDK
Commits
347df4f3
Commit
347df4f3
authored
Apr 26, 2024
by
Javokhir
Browse files
Fixed drawable name is null bug
parent
c4a91b91
Changes
5
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
347df4f3
## 1.2.3
*
🔨 Fixed a bug in Android where retrieving a drawable resource by its name caused errors or returned "name is null" error.
## 1.2.2
## 1.2.2
*
🔥 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.
...
...
android/src/main/kotlin/uz/uzinfocom/myid/MyIdSdk.kt
View file @
347df4f3
package
uz.uzinfocom.myid
package
uz.uzinfocom.myid
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.res.Resources.NotFoundException
import
android.os.Build
import
android.os.Build
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel
import
uz.myid.android.sdk.capture.MyIdClient
import
uz.myid.android.sdk.capture.MyIdClient
...
@@ -119,9 +121,11 @@ class MyIdSdk(
...
@@ -119,9 +121,11 @@ class MyIdSdk(
val
orgMap
=
config
[
"organizationDetails"
]
as
?
HashMap
<
String
,
Any
?
>
val
orgMap
=
config
[
"organizationDetails"
]
as
?
HashMap
<
String
,
Any
?
>
val
drawableName
=
orgMap
?.
fetch
(
"logo"
)
val
drawableName
=
orgMap
?.
fetch
(
"logo"
)
val
packageName
=
currentActivity
?.
packageName
val
drawableId
=
try
{
val
resources
=
currentActivity
?.
resources
currentActivity
?.
resIdByName
(
drawableName
,
"drawable"
)
val
drawableId
=
resources
?.
getIdentifier
(
drawableName
,
"drawable"
,
packageName
)
}
catch
(
e
:
NotFoundException
)
{
null
}
organizationDetails
=
MyIdOrganizationDetails
(
organizationDetails
=
MyIdOrganizationDetails
(
phoneNumber
=
orgMap
?.
fetch
(
"phone"
),
phoneNumber
=
orgMap
?.
fetch
(
"phone"
),
...
@@ -202,4 +206,11 @@ class MyIdSdk(
...
@@ -202,4 +206,11 @@ class MyIdSdk(
}
}
return
result
?.
toString
().
orEmpty
()
return
result
?.
toString
().
orEmpty
()
}
}
private
fun
Context
.
resIdByName
(
resIdName
:
String
?,
resType
:
String
):
Int
{
resIdName
?.
let
{
return
resources
.
getIdentifier
(
it
,
resType
,
packageName
)
}
throw
NotFoundException
()
}
}
}
\ No newline at end of file
example/lib/main.dart
View file @
347df4f3
...
@@ -37,10 +37,6 @@ class _MyAppState extends State<MyApp> {
...
@@ -37,10 +37,6 @@ class _MyAppState extends State<MyApp> {
clientHashId:
clientHashId
,
clientHashId:
clientHashId
,
buildMode:
MyIdBuildMode
.
PRODUCTION
,
buildMode:
MyIdBuildMode
.
PRODUCTION
,
entryType:
MyIdEntryType
.
AUTH
,
entryType:
MyIdEntryType
.
AUTH
,
organizationDetails:
const
MyIdOrganizationDetails
(
phone:
"phone"
,
logo:
"logo1"
,
)
),
),
iosAppearance:
const
MyIdIOSAppearance
()
iosAppearance:
const
MyIdIOSAppearance
()
);
);
...
...
example/pubspec.lock
View file @
347df4f3
...
@@ -121,7 +121,7 @@ packages:
...
@@ -121,7 +121,7 @@ packages:
path: ".."
path: ".."
relative: true
relative: true
source: path
source: path
version: "1.2.
2
"
version: "1.2.
3
"
path:
path:
dependency: transitive
dependency: transitive
description:
description:
...
...
pubspec.yaml
View file @
347df4f3
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.
2
version
:
1.2.
3
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment