Search code examples
ibm-mobilefirsthybrid-mobile-appmobilefirst-server

IP address/ OS version and device key


I have MobileFirst (V7.O) Hybrid app . How can I get the current IP address, OS version (android nnn, Iphone nnn), Device unique Id for the device. Basically, I am recording some information at various point in my app.

Can you please provide some hints and how to get this information

Thanks for your help


Solution

  • You can be found deviceID & IP address below information

    unique deviceID

    WL.Device.getID({onSuccess : function(o) { 
       alert(o.deviceID); 
    }, onFailure : function(e) { 
    WL.Logger.info("Error getting ID: " + e); 
    }});
    

    IP address

    WL.Device.getNetworkInfo(function (networkInfo) {
        alert (networkInfo.ipAddress); 
    });
    

    Device OS version use cordova

    var deviceVersion = device.version;
    

    check cordova api https://cordova.apache.org/docs/en/3.0.0/cordova/device/device.html

    more this link http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WL.Device.html?cp=SSZH4A_6.2.0%2F10-0-0-1-9