javascript - Getting ip address into my own code... (cordova - cordova-plugin-networkinterface) -
i'm having lot of troubles, trying ip adress variable, in javascript. function, here, work correctly: gives me alert, correct ip address.
networkinterface.getipaddress(function (ip) { alert(ip); });
but when try ip in order in own code (myip), can't seem working :
myip = networkinterface.getipaddress(function (ip) { return ip;} );
what doing wrong, here ?
all plugin things in cordova event driven. means, can't set variable do.
what have write way:
networkinterface.getipaddress(function (ip) { // logic here }
what can is, use triggers.
Comments
Post a Comment