Getting Country ISD code

Getting Country ISD code

  

I want to get the user's country ISD code to auto populate the country ISD code field like whats app.

In whats app, when using it for the first time, it will ask for the mobile number to send verification code, in that screen the country code is automatically populated. I want to do the same thing in Out systems app.

Please let me know how to get the user's country ISD code.

I have also attached the whats app verification screen where the county (along with county code) is auto populated.

Hi Kartick,

There are some providers online that can give you a list of country-related info, including the Dialing Codes of all countries.

Import such a list as an entity (can be static, depending on your needs) and use the values from the table.

For instance you can use the data from https://countrycode.org/ 

Kind regards,

Remco Dekkinga

Thanks Remco. 

I have the country isd list but how to get the current user country or country code progrmatically ?


Only if i know the user's country or country code, i can populate the field.

Solution

Hi Kartick,

When you want the current country of the user, you can use an online ip2location service, a downloadable database with all countries (check out the GeoLocation plugin) or ask the current country of the user when he is being registered.

An example of an ip2location webservice: http://ipinfo.io/

An example of an ip2location database: https://www.ip2location.com/

Kind regards,

Remco

Solution

Thanks Remco