You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method for determining a number's type is incorrect for numbers from a region not the "main country" of a country code. For example:
func testAntiguaPagerNumber(){
guard let number =try?PhoneNumber(rawNumber:"12684061234")else{XCTFail()return}XCTAssertEqual(number.type,PhoneNumberType.Pager)}
fails because the type determination uses US metadata instead of AG metadata.
The text was updated successfully, but these errors were encountered:
fikus
changed the title
PhoneNumber.type is incorrect for numbers that are not from main country
Determination of PhoneNumber.type is incorrect
Mar 17, 2016
In addition to using the incorrect metadata described above, the type determination can also be incorrect based on the usage of possibleNumberPattern. (This is related to the workaround in #33)
Example:
func testUSTollFreeNumberType(){
guard let number =try?PhoneNumber(rawNumber:"8002345678")else{XCTFail()return}XCTAssertEqual(number.type,PhoneNumberType.TollFree)}
The type is incorrectly determined to be PremiumRate because the premium rate possible number pattern is the generic pattern \d{10}.
The method for determining a number's type is incorrect for numbers from a region not the "main country" of a country code. For example:
fails because the type determination uses US metadata instead of AG metadata.
The text was updated successfully, but these errors were encountered: