marmelroy / PhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
MIT License
5.13k stars 817 forks source link

It's impossible to identify Mexican numbers with (1) #779

Closed 2jumper3 closed 4 months ago

2jumper3 commented 4 months ago

Mexican numbers have an additional digit (1) in some cases. If such a number is provided to parse, it returns an "invalid Number" error.

Steps to reproduce

Provide the Mexican number in international format in phoneNumberKit.parse. For example, +52 (1) 55 1111 1111.

Expected result

Expected parsedNumber: PhoneNumber type

Actual result

invalidNumber Error

Environment

SPM 3.7.10

bguidolim commented 4 months ago

Hey @2jumper3

I've created the bug template for new issues here exactly to avoid this kind of issues. This is about metadata, it should be updated at the libphonenumber repo.

The bug template contains a link where you can check if the phone number is valid or not using the original library.

The rule of thumb is: the original lib and PhoneNumberKit should have the same response.

2jumper3 commented 4 months ago

@bguidolim Hi and many thanks for your answer. Did I understand you correctly that this issue needs to be addressed to the Google library, not here?

bguidolim commented 4 months ago

That's right.