nyaruka / phonenumbers

GoLang port of Google's libphonenumber library
MIT License
1.25k stars 148 forks source link

Guess the country code by IP #170

Closed gedw99 closed 6 months ago

gedw99 commented 6 months ago

The way it works now requires 2 fields.

Country code and then phone number .

It’s likely possible to also provide a web gui and API that can do it with a single field and smart responses to hint to the user ?

For example humans tend to not put in the country code , but we can detect their country code from their IP address, and so add it for them , etc.

there are some very good golang packages for detecting a users country via the IP they come in on and mapping that to an ENUM country code.

https://github.com/ip2location/ip2location-go Is just one of these packages.

there are ones that embed the meta data just like this repo does , which is better .

rowanseymour commented 6 months ago

I need to stress this project is strictly a port of https://github.com/google/libphonenumber so we only add functionality if it also exists in that project.