I am having an issue getting the correct country back from getRegionCode(forCountryCode:). For the following code, I am getting "US" back when I should be getting "CA". Can someone tell me if there is an issue with the library or if my code is incorrect?
let fullPhoneNumber = "+15065552222"
guard let phoneUtil = NBPhoneNumberUtil.sharedInstance() else {
return "error"
}
do {
let phoneNumber = try phoneUtil.parse(fullPhoneNumber, defaultRegion: "ZZ")
return phoneUtil.getRegionCode(forCountryCode: phoneNumber.countryCode)
} catch {
return "error"
}
I am having an issue getting the correct country back from getRegionCode(forCountryCode:). For the following code, I am getting "US" back when I should be getting "CA". Can someone tell me if there is an issue with the library or if my code is incorrect?