BlinkID / blinkid-flutter

ID scanning plugins for cross-platform apps built with Flutter.
77 stars 23 forks source link

Unable to Customize 'Network Error' Dialog Text #71

Closed radivojeostojic closed 2 days ago

radivojeostojic commented 6 days ago

Currently, when I'm on the scanning screen and there is no internet connection, a generic native dialog with the title 'Network error' is displayed. Is there a way to customize this text to something else?

Screenshot 2024-09-11 at 20 19 36
mparadina commented 5 days ago

Hi @radivojeostojic

There is no direct way to change this string directly via the SDK settings. However, you can create your own strings.xml file and override the strings.

For example, in our sample app, the path where you would create the strings.xml file would be: blinkid-flutter/sample/android/app/src/main/res/values

In the file, you can override it by adding the following:

<?xml version="1.0" encoding="UTF-8"?>
<resources tools:ignore="DuplicateStrings,UnusedResources" xmlns:tools="http://schemas.android.com/tools">    
    <string name="mb_licence_check_failed">Your own network error message</string>
</resources>

Let me know if this helps.

radivojeostojic commented 5 days ago

Hey @mparadina , thanks for the reply. I was able to change the text for Android using strings.xml, but I haven't found a way to do this on iOS yet. Do you happen to know where I should look or how to make the change?

mparadina commented 5 days ago

Hi @radivojeostojic Of course, glad I could help!

For iOS, you can directly change the .strings file inside the BlinkID.xcframework. For example, for English, you can change the en.strings file.

You can also override the strings by following the guide here.

Let me know if you have any additional questions.

radivojeostojic commented 2 days ago

Thanks for the help, I am closing this issue because now.