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
Show 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
*
🔥 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
import
android.app.Activity
import
android.content.Context
import
android.content.res.Resources.NotFoundException
import
android.os.Build
import
io.flutter.plugin.common.MethodChannel
import
uz.myid.android.sdk.capture.MyIdClient
...
...
@@ -119,9 +121,11 @@ 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
)
val
drawableId
=
try
{
currentActivity
?.
resIdByName
(
drawableName
,
"drawable"
)
}
catch
(
e
:
NotFoundException
)
{
null
}
organizationDetails
=
MyIdOrganizationDetails
(
phoneNumber
=
orgMap
?.
fetch
(
"phone"
),
...
...
@@ -202,4 +206,11 @@ class MyIdSdk(
}
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> {
clientHashId:
clientHashId
,
buildMode:
MyIdBuildMode
.
PRODUCTION
,
entryType:
MyIdEntryType
.
AUTH
,
organizationDetails:
const
MyIdOrganizationDetails
(
phone:
"phone"
,
logo:
"logo1"
,
)
),
iosAppearance:
const
MyIdIOSAppearance
()
);
...
...
example/pubspec.lock
View file @
347df4f3
...
...
@@ -121,7 +121,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.
2
"
version: "1.2.
3
"
path:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
347df4f3
name
:
myid
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
repository
:
https://pub.dev/packages/myid
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