libPhoneNumber-iOS icon indicating copy to clipboard operation
libPhoneNumber-iOS copied to clipboard

NBPhoneNumberUtil.isNumberMatch fails on version 1.0.1

Open cassianodialpad opened this issue 4 years ago • 3 comments

The test below works fine on version 1.0.0, but fails on version 1.0.1 and 1.0.2 (it returns NOT_A_NUMBER instead of EXACT_MATCH).

let formatter = NBPhoneNumberUtil()
let number = "+16508636853"
let result = formatter.isNumberMatch(number, second: number, error: nil)
XCTAssertEqual(result, .EXACT_MATCH)

On my digging, I found out that this line of code is returning nil on NormalizeNonBreakingSpace(numberToParse). I wasn't able to figure out why... =/

https://github.com/iziz/libPhoneNumber-iOS/blob/8efc8d1b75fc8dc97464acd7eb23a9a2719e9141/libPhoneNumber/NBPhoneNumberUtil.m#L3602

cassianodialpad avatar Sep 17 '20 20:09 cassianodialpad

Thanks for this! I was already wondering why it wasn't working anymore after switching from CocoaPods to SPM; it was the version instead.

I ended up using 37f3d36cf4ef3de74d8c44838a0266976b24fcb7 for now, as that seems to be the last working version (as you mention: 1.0.0).

JeroenJK avatar Oct 23 '20 11:10 JeroenJK

Try this out: https://github.com/iziz/libPhoneNumber-iOS/issues/324

simonmitchell avatar Dec 10 '20 18:12 simonmitchell

Great, thanks!

cassianodialpad avatar Dec 15 '20 18:12 cassianodialpad