PhoneNumberKit
PhoneNumberKit copied to clipboard
Not able to validate Emergency number using PhoneNumberKit
Hi
I am using pod 'PhoneNumberKit', '~> 3.3'
PhoneNumber is correctly validating with country code. but when I tried below code it gives me error.
do {
let emergencyNumber = "+1 911"
let phoneNumberCustomDefaultRegion = try phoneNumberKit.parse(emergencyNumber, withRegion: "US", ignoreType: false)
}
catch {
print("Generic parser error \(error.localizedDescription)")
}
**Error** Generic parser error The number provided is invalid.
Any Help will be really appreciated.
Thanks in Advance.
Hey @NathaSuleSM, Unfortunately with this project we are relying on the Google metadata, and it seems that this metadata is also marking the emergency number as invalid: https://libphonenumber.appspot.com/phonenumberparser?number=911&country=US.
What I can suggest is to open an issue with the Google guys on this link: https://issuetracker.google.com/issues/new?component=192347&title=Validation+issue+with+911+%28US%29, and we would be happy to update the metadata in this project, when they have a solution for it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.