Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone number on IOS does not work with country code #379

Open
amirbahrawy opened this issue Mar 14, 2023 · 6 comments
Open

Phone number on IOS does not work with country code #379

amirbahrawy opened this issue Mar 14, 2023 · 6 comments

Comments

@amirbahrawy
Copy link

Describe the bug
On getRegionInfoFromPhoneNumber has flutter: PlatformException(1, The country code is invalid., null, null) on iOS.
On Android works fine

Package version
last version

Flutter version
3.0.5

@orangeyong
Copy link

orangeyong commented Mar 18, 2023

I face this issue too, happen when the input comes without country code, no issue before this.

And I have made a few assumption on the input, and found out the bug below
from flutter's getRegionInfoFromPhoneNumber(phoneNumber, isoCode)

  1. if i set the isoCode to "MY" => return positive result
    1.1 but when I call for result.dialCode => I get "MY"
    1.2 tried to insert "" as empty string for countryCode => exception
    1.3 tried to insert phoneNumber without +60 (the country code) => exception

Printing the parsed phone number props property returns [+6011xxxxxxxx, MY, MY]

My guess is that the new PhoneNumberKit is validating wrong input field, and thus returning wrong

@honzasima
Copy link

for fix use older dependency, problem is not in this package:

dependency_overrides:
libphonenumber_plugin: 0.2.3

@amirbahrawy
Copy link
Author

for fix use older dependency, problem is not in this package:

dependency_overrides: libphonenumber_plugin: 0.2.3

it worked well but is there another solution or this the only thing i can do ?

@sangmoonhwang
Copy link

sangmoonhwang commented Apr 30, 2023

For fix use older version dependency

dependency_overrides: libphonenumber_plugin: 0.2.3

This does not sounds like a long-term fix since we would be stuck with the old dependency and its transitive dependencies.
Is there a better way to solve this issue or should we just wait for the next libphonenumber_plugin version?

@chiptech-mitchell
Copy link

chiptech-mitchell commented May 17, 2023

I used the last version of intl_phone_number_input (0.7.3+1) and overrode the libphonenumber_plugin to the latest (0.3.1) and the seems to be the best fix until the PR #375 is merged and new version is released.

@osamamohammed98
Copy link

for fix use older dependency, problem is not in this package:

dependency_overrides: libphonenumber_plugin: 0.2.3

thanks for your help
it's work with me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants