We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code example:
let numberPhone = try PhoneNumber(rawNumber: "(636) 275-4512") let countryCodeNumber = numberPhone.countryCode let phoneNumberKit = PhoneNumberKit() var countryCode = phoneNumberKit.countriesForCode(countryCodeNumber)?.first
log: countryCodeNumber = 1
countryCode = "AG" // Should be US
The text was updated successfully, but these errors were encountered:
Hi @redcirclegame!
Thanks for this. The issue here is that you don't get the main country for a dialing code by asking for the first country in the array.
There is a specific function for this:
let countryCode = PhoneNumberKit().mainCountryForCode(countryCodeNumber)
returns US
Sorry, something went wrong.
Oh, i see, thanks for such quick response @marmelroy !
No branches or pull requests
Code example:
log:
countryCodeNumber = 1
countryCode = "AG" // Should be US
The text was updated successfully, but these errors were encountered: