Coder Social home page Coder Social logo

Comments (24)

emillenard avatar emillenard commented on July 25, 2024 7

I have the same problem.
On getRegionInfoFromPhoneNumber has flutter: PlatformException(1, The country code is invalid., null, null) on iOS.
On Android works fine.

from intl_phone_number_input.

bynalab avatar bynalab commented on July 25, 2024 2

@emillenard Sorry, I'll look into the issue today and see if I can get @natintosh to push some fixes out on this and other issues. Meanwhile, fixes PRs will be welcomed if anyone can help with fixing some of the issues created.

from intl_phone_number_input.

emillenard avatar emillenard commented on July 25, 2024 2

@emillenard @hrishikeshpujari1902 How to apply the fix the the swift file? Where is it? We need urgent fix in production. Is there a previous version which works fine?
@hrishikeshpujari1902

hi, is not the best approach, but for quick fix to production until will be ok in library i changed the file from Pods , you will find the SwiftLibphonenumberPlugin.swift in Xcode on Pods/PhonKitNumber folder , change it and then compile the version.

from intl_phone_number_input.

joshuamoreno1 avatar joshuamoreno1 commented on July 25, 2024 1

I have both problems

from intl_phone_number_input.

BenSalemOumaima avatar BenSalemOumaima commented on July 25, 2024 1

I have the same issue with the latest version

from intl_phone_number_input.

emillenard avatar emillenard commented on July 25, 2024 1

The quiq fix for me was to change in library:

Changes in: input_widget.dart line 184
From: "String phoneNumber = await PhoneNumber.getParsableNumber(widget.initialValue!);"
To: "String phoneNumber = widget.initialValue!.parseNumber();"

Changes in: SwiftLibphonenumberPlugin.swift
line 81
From: "let countryCode: String? = phoneNumberKit.mainCountry(forCode: p.countryCode)"
To: "let countryCode = "+" + String(p.countryCode)"
line 77:
From: "let p: PhoneNumber = try phoneNumberKit.parse(phoneNumber, withRegion: isoCode.uppercased(), ignoreType: true)"
To:" let p: PhoneNumber = try phoneNumberKit.parse(phoneNumber)"

from intl_phone_number_input.

honzasima avatar honzasima commented on July 25, 2024 1

For fix use older version dependency

dependency_overrides:
libphonenumber_plugin: 0.2.3

from intl_phone_number_input.

tujii avatar tujii commented on July 25, 2024

Having the same issue :(

from intl_phone_number_input.

alabbasiDev avatar alabbasiDev commented on July 25, 2024

Having the same issue too

from intl_phone_number_input.

celiamaurewide avatar celiamaurewide commented on July 25, 2024

Having the same issue

from intl_phone_number_input.

DanielBerrioB avatar DanielBerrioB commented on July 25, 2024

Having the same issue

from intl_phone_number_input.

zynhrus avatar zynhrus commented on July 25, 2024

Having the same issue

Any update?

from intl_phone_number_input.

emillenard avatar emillenard commented on July 25, 2024

Nobody seems to care about this problem.

from intl_phone_number_input.

emillenard avatar emillenard commented on July 25, 2024

@bynalab thanks, i found the problem, is in phone_number.dart the regionInfo.regionPrefix is the same with regionInfo.isoCode on iOS.

from intl_phone_number_input.

ydpatel1 avatar ydpatel1 commented on July 25, 2024

@bynalab thanks, i found the problem, is in phone_number.dart the regionInfo.regionPrefix is the same with regionInfo.isoCode on iOS.

Do you have any solution?

from intl_phone_number_input.

hrishikeshpujari1902 avatar hrishikeshpujari1902 commented on July 25, 2024

@emillenard SwiftLibphonenumberPlugin.swift where is this file located

from intl_phone_number_input.

tigrenok00 avatar tigrenok00 commented on July 25, 2024

@emillenard @hrishikeshpujari1902 How to apply the fix the the swift file? Where is it? We need urgent fix in production.
Is there a previous version which works fine?

from intl_phone_number_input.

tigrenok00 avatar tigrenok00 commented on July 25, 2024

@natintosh @bynalab Is there a workaround to be had? Will appreciate a fix for this ASAP!

from intl_phone_number_input.

hrishikeshpujari1902 avatar hrishikeshpujari1902 commented on July 25, 2024

@tigrenok00
Do these changes in the local pub cache as a temporary fix.
It will not format the number like added spaces in between but it wont add the extra country code as well.
Changes in: input_widget.dart line 184
From: "String phoneNumber = await PhoneNumber.getParsableNumber(widget.initialValue!);"
To: "String phoneNumber = widget.initialValue!.parseNumber();"

from intl_phone_number_input.

EUGinsane avatar EUGinsane commented on July 25, 2024

I got same errors as above.
can someone explain why this happens? Because I did not upgrade the package, still in version 0.7.0+2 since the first day, and now it suddenly breaks. Thanks

from intl_phone_number_input.

amirbahrawy avatar amirbahrawy commented on July 25, 2024

@emillenard @hrishikeshpujari1902 How to apply the fix the the swift file? Where is it? We need urgent fix in production. Is there a previous version which works fine?
@hrishikeshpujari1902

hi, is not the best approach, but for quick fix to production until will be ok in library i changed the file from Pods , you will find the SwiftLibphonenumberPlugin.swift in Xcode on Pods/PhonKitNumber folder , change it and then compile the version.

can you explain clearly what you did exactly ?

from intl_phone_number_input.

danysz avatar danysz commented on July 25, 2024

+1

from intl_phone_number_input.

ovchars2 avatar ovchars2 commented on July 25, 2024

For fix use older version dependency

dependency_overrides: libphonenumber_plugin: 0.2.3

This worked for our project, thank you

Flutter 2.8.1
intl_phone_number_input 0.7.0+2
libphonenumber_plugin 0.2.3 (downgraded from 0.2.5)

from intl_phone_number_input.

sangmoonhwang avatar sangmoonhwang commented on July 25, 2024

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?

from intl_phone_number_input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.