Can we get the app version and IP address info using worklight api?

可紊 提交于 2019-12-20 07:09:15

问题


In my worklight hybrid app, I want to get two info:

  1. app version (the version the end-user sees in the various App Stores or in the device)
  2. IP address

How can I do it?


回答1:


IP address: The Worklight Hybrid application does not have any IP address. The client (the app...) connects to the Worklight Server. The IP address you set the client to connect to is set in application-descriptor.xml as the value of worklightServerRootURL.

If you mean that you're actually looking for the device IP address, you can get this using WL.Device.getNetworkInfo.

App version: Like with the IP address, the "version" of the Worklight application is set as well in application-descriptor.xml as an attribute of the environment element.

<android version="1.0">
...
...
...
</android>

You can retrieve it by using WL.Client.getAppProperty("APP_VERSION").



来源:https://stackoverflow.com/questions/16418352/can-we-get-the-app-version-and-ip-address-info-using-worklight-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!