2

I need to get client's public ip and geolocation using some api : ipapi.co, ip-api.com, ipdata.co, etc. and grab its json result, I tried with : new qx.io.request.Xhr without luck. Can someone tell me how to get this info using any of these apis ? Thanks

R. Islas
  • 71
  • 4

1 Answers1

2

Ok, after some hours digging blogs and forums, I got the info using :

var url = 'https://ipinfo.io/json';
var jsonStore = new qx.data.Store.Json(url);

jsonStore.addListener( 'loaded', function(e) {
var ipdata = e.getData();
console.log( ipdata.getIp() )
}, this);

In case someone else might need it.

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
R. Islas
  • 71
  • 4