Is there a way to get Geo location from the IP address of the user?
If user agrees, I collect Geo Location using: navigator.geolocation.getCurrentPosition()
but if the user refuses, I want to get it from the IP address although it is not accurate.
Is there a way to get Geo location from the IP address of the user?
If user agrees, I collect Geo Location using: navigator.geolocation.getCurrentPosition()
but if the user refuses, I want to get it from the IP address although it is not accurate.
Yes, you can use an external API such as freegeoip : https://freegeoip.net/
Example of json response :
GET call : http://freegeoip.net/json/2.4.44.12
Where "2.4.44.12" is the IP address
But there are many other API doing the same thing, just look over the web which one you want to use.