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

Library does not recognise Swaziland Country Code +268 #364

Closed
4 tasks
tariromukute opened this issue Aug 22, 2023 · 8 comments
Closed
4 tasks

Library does not recognise Swaziland Country Code +268 #364

tariromukute opened this issue Aug 22, 2023 · 8 comments

Comments

@tariromukute
Copy link

tariromukute commented Aug 22, 2023

Hi, thank you for this library.

I am using it to get the country for users accessing a chatbot via WhatsApp. Since the phone number come via WhatsApp, it's safe to assume they are all valid number. I have noticed that the library:

  • does not recognise +268 phone numbers see document
  • does not recognise some phone numbers from Botswana +267778xxxxx see Page 7
  • does not recognise some phone numbers from Malawi +265984xxxxxx Last page
  • does not recognise some phone numbers from Zimbabwe +263864xxxxxxx, see Page 6
@Bossa573
Copy link
Member

hello, for all reports, please include the reference information such as PDFs, websites, etc. Thank you very much.

@tariromukute
Copy link
Author

tariromukute commented Aug 22, 2023

hello, for all reports, please include the reference information such as PDFs, websites, etc. Thank you very much.

Hi @Bossa573, I am not sure I understand this. Do you mean the link to the application I am using the library with. Or you mean some ISO standards to documentation.

@Bossa573
Copy link
Member

any docs works, like each countries government official docs / website, wiki pages, or even 3rd party references showing your number format should be the valid mobile phone number formats.

@tariromukute
Copy link
Author

Ohk noted. I found the ITU portal with the documents per country, see link. I have also updated the issue with the links and page number for each set of phone numbers not being recognised.

@Bossa573
Copy link
Member

  1. for +268, I found that there's no data in the lib (https://github.com/AfterShip/phone/blob/master/src/data/country_phone_data.ts#L1633)
  2. for +267, can add '77', '78' and '79' prefix (https://github.com/AfterShip/phone/blob/master/src/data/country_phone_data.ts#L312C48-L312C50)
  3. for +265, the docs show 77, 88, 99 prefix, which match our data (https://github.com/AfterShip/phone/blob/master/src/data/country_phone_data.ts#L1211)
    image
    the doc doesn't seem to show +265-984xxxxxx is a correct format
  4. for +263, 864xxxxxxx is the range of VoIP, which does not include in our lib's scope

@tariromukute
Copy link
Author

Hey @Bossa573, thanks for checking the documents out.
3. How will do a further search later, maybe the document is not up to date
4. I am guessing it is possible for someone to create a WhatsApp account using VOIP, if they select the option to verify via a call. I probably have to find a work around on this one, probably for a phone number that the package undefined for phone('+263xxxxx').countryIso2?.toLowerCase() I check if the number starts with +263.

Bossa573 added a commit that referenced this issue Aug 23, 2023
- #364 fixed Swaziland and Botswana phone data
@Bossa573
Copy link
Member

https://www.npmjs.com/package/phone/v/3.1.40
handle (1) and (2)

upcoming updates for the new format, if possible please try to create the PR as well, thank you very much.

@tariromukute
Copy link
Author

https://www.npmjs.com/package/phone/v/3.1.40 handle (1) and (2)

upcoming updates for the new format, if possible please try to create the PR as well, thank you very much.

Thank you @Bossa573! Sure no problem, I will raise a PR for 3 or 4 depending on the information I find. Cheers.

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

2 participants