2

In the AppConKit, you can give your users the option to configure a Servername, port and path in the Settings that this Apps connects to. Can I somehow access these configured settings in the Javascript code? My use-case is that I have a logo image sitting on the server the app is connecting to, and would like to show this logo based on the server url. Any Idea?

4

1 回答 1

1

有道理,但这不是一个容易访问的设置(还)。

您可以通过设备开关访问设置:

var hostname;
var port;
var path;
if (vMobileController.device().isAndroid()) {
    hostname = vKVS.value("Weptun_Hostname");
    port = vKVS.value("Weptun_Port");
    path = vKVS.value("Weptun_URL_Path");
} else { 
    hostname = vKVS.value("server_url");
    port = vKVS.value("server_port");
    path = vKVS.value("server_endpoint");
}
if (hostname.substring(0,4)!="http") {
    hostname="http://"+hostname;
}
var vUrl = hostname+":"+port+"/"+path+"/images/Logo.png";

我与开发人员交谈过,通过直接 Javascript API 访问它是有意义的。我会看到它已添加到路线图中!

于 2013-06-12T11:57:44.000 回答