IPGeolocation / ip-geolocation-api-javascript-sdk

IP Geolocation API Javascript SDK
17 stars 11 forks source link

Error with the first example of the doc #5

Closed sbusso closed 5 years ago

sbusso commented 6 years ago

In the first example of the sdk console.log(ipgeolocationApi.getGeolocation()); it cant work as default params is null and then it calls getIps from null.

https://github.com/IPGeolocation/ip-geolocation-api-javascript-sdk/blob/d4452dae34b857f4fcf3bf2a39c7916d79b8439e/IPGeolocationAPI.js#L15

usmanbinliaqat commented 5 years ago

In the first example of the sdk console.log(ipgeolocationApi.getGeolocation()); it cant work as default params is null and then it calls getIps from null.

ip-geolocation-api-javascript-sdk/IPGeolocationAPI.js

Line 15 in d4452da if(params.getIps()) {

Resolved. As ipAddresses is an array, so it should be an empty array by default and not the null. Please download the latest SDK and test if it works for you.