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

iOS 16.6.1 breaking change - Invalid Country Code Error #398

Open
micahburnside opened this issue Oct 17, 2023 · 0 comments
Open

iOS 16.6.1 breaking change - Invalid Country Code Error #398

micahburnside opened this issue Oct 17, 2023 · 0 comments

Comments

@micahburnside
Copy link

Devices that have iOS 16.6.1 and beyond throw an invalid country code error.

This code works for iOS versions prior to 16.6.1. Any iOS version after 16.6.1 throws an invalid country code error even though it is a valid country code. When this code is run on devices with iOS 16.3.1 it does not throw an error.

I haven't been able to test anything between iOS 16.3.1 and 16.6.1, but I do believe the break happened with 16.6.1.

let phoneNumberUtility = NBPhoneNumberUtil()
do {
let nbPhone : NBPhoneNumber = try phoneNumberUtility.parse(withPhoneCarrierRegion: phone)
let phoneNumber : NSNumber = nbPhone.nationalNumber
let countryCode: NSNumber = nbPhone.countryCode
print(phoneNumber,countryCode)
phoneNumbers.append(("+(countryCode)") + " " + ("(phoneNumber)"))
} catch let error as NSError {
print("Phone Number Invalid! Error: (error.localizedDescription)")
}

Error Print Statement:

Phone Number Invalid! Error: Error Domain=INVALID_COUNTRY_CODE Code=0 "INVALID_COUNTRY_CODE:--" UserInfo={NSLocalizedDescription=INVALID_COUNTRY_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

1 participant