You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that this library is not responsible of adding/removing/changing phone number formats and any request should be done at libphonenumber repo
Steps to reproduce
I'm trying to validate a phone number provided for a specific region, but if I give it with the country code behind it ignores the region I'm passing it and considers it valid.
let validPhoneNumber = phoneNumberKit?.isValidPhoneNumber("+351916693528", withRegion: "US")
Expected result
validPhoneNumber should be false
Actual result
validPhoneNumber is true
The text was updated successfully, but these errors were encountered:
If you are using the international code, you shouldn't send the region.
The parsing logic contains a couple of fallbacks to always try to bring the right result in the end, so if you send the international code AND the region, when the parsing for the region fails, it will fallback to the international code.
New Issue Checklist
Steps to reproduce
I'm trying to validate a phone number provided for a specific region, but if I give it with the country code behind it ignores the region I'm passing it and considers it valid.
Expected result
validPhoneNumber
should be falseActual result
validPhoneNumber
is trueThe text was updated successfully, but these errors were encountered: