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

I need to format a "test" phone number to E164 but parse() throws #77

Closed
sorth-hiya opened this issue Oct 19, 2016 · 3 comments
Closed

Comments

@sorth-hiya
Copy link
Contributor

Great library but it fails to parse some phone numbers (e.g invalid area code, etc). For example, in the iOS simulator the sample Contact Kate Bell has the number (555) 564-8583. I would like to be able to get the E164 format for this number, but parse fails. Could you please provide a way to bypass the area-code validation, so I can still format test phone numbers?

@Junus
Copy link

Junus commented Nov 30, 2016

@sorth-hiya did you found solution for this?

@marmelroy
Copy link
Owner

With recent versions of PhoneNumberKit you can ignoreType on parse, for example:

try phoneNumberKit.parse("+16307792428", ignoreType: true, withRegion: "US")

@varungoyal44
Copy link

I did some research into this number. 555 does not seem to be a valid area code.

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

4 participants