Hi @chan_austria777
, sure! I am basing my decision of what country to auto-select according to the client's public IP address. Note that it's not 100% correct since you might be using a VPN or something that alters your IP address but for my needs it was enough. To detect the IP address I am using the following ipapi.co API, specifically the following /GET ipapi.co/json/ endpoint which results with a simple JSON that you can retrieve the user's country code from.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
there's a widget that defaults to the current country of the viewer. Would you mind sharing how to do that?
Hi @chan_austria777 , sure! I am basing my decision of what country to auto-select according to the client's public IP address. Note that it's not 100% correct since you might be using a VPN or something that alters your IP address but for my needs it was enough. To detect the IP address I am using the following ipapi.co API, specifically the following /GET ipapi.co/json/ endpoint which results with a simple JSON that you can retrieve the user's country code from.