PhoneNumberKit icon indicating copy to clipboard operation
PhoneNumberKit copied to clipboard

`isValidPhoneNumber` returning true ignoring region

Open miguelgazela opened this issue 6 months ago • 3 comments

New Issue Checklist

  • [x] Updated PhoneNumberKit to the latest version
  • [x] Phone number formatted correctly on JavaScript version
  • [x] I searched for existing GitHub issues
  • [x] 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

miguelgazela avatar Aug 01 '24 14:08 miguelgazela