iziz / libPhoneNumber-iOS

iOS port from libphonenumber (Google's phone number handling library)
Apache License 2.0
2.36k stars 463 forks source link

phonenumber invalid #332

Open xsgoing opened 3 years ago

xsgoing commented 3 years ago

this is my phone number, but return isvalid is false, libPhoneNumber-iOS (0.9.15) 84-862926295

aatamburus commented 3 years ago

I have the same problems. My code worked previously and is no longer working after I got the latest version.

let parsedNumberRaw = try? NBPhoneNumberUtil.init().parse(phoneNumber, defaultRegion: code.countryRegion)
 guard let parsedNumber = parsedNumberRaw, NBPhoneNumberUtil.init().isValidNumber(parsedNumber) else {
           return .invalid(option:.phoneNumberDigit(phoneNumber))
 }

 return .valid(option:.phoneNumberDigit(phoneNumber))

I detected that NBPhoneNumberUtil.init ().parse returns the error INVALID_CODE_COUNTRY, but I don't know why

BFTE commented 3 years ago

Hi, I got the same problem after update from 0.9.15 to 1.0.2 version.

jlab13 commented 3 years ago

And i got the same problem on 1.0.2 version. Version 1.0.0 works fine.

nearbyestatesales commented 3 years ago

did anyone figure out why 1.0.2 doesn't work out of the box when you upgrade from 0.9.15. what happens in my case, is the number is nil before it is send to be validated. Nothing has changed in the code. used to work before. Please let me know. I upgraded to get the latest metadata, but if there is a way to get the new metadata without having to upgrade to 1.0.2. I can do that too.

simonmitchell commented 3 years ago

This did the trick for me! https://github.com/iziz/libPhoneNumber-iOS/issues/324

JamesDougherty commented 2 years ago

Thank you @simonmitchell!