移动优先在iOS设备中自动更新失败,同时在运行时更改服务器URL

时间:2017-04-28 11:54:24

标签: ibm-mobilefirst mobilefirst-adapters mobilefirst-server mobilefirst-studio mobilefirst-appcenter

我正在开发一个IBM MobileFirst Platform 7.1项目,我们有许多远程服务器,例如开发,测试等。要求是在运行时更改服务器以便我们不需要构建和分发多个应用程序。

我关注了官方IBM tutorial

以下是我在服务器更改后用于连接服务器的代码。

WL.Client.connect({onSuccess: function(){
        WL.SimpleDialog.show(
                "Connection Success", "Successfully connected to the server URL. Your app will reload once you press OK",  
                [{text: "OK", handler: function() {WL.Client.reloadApp();}}]
        );
    }, onFailure: function(error) {
        WL.SimpleDialog.show(
                "Connection Falied", error.status +" "+error.errorCode + " : " + error.errorMsg,  
                [{text: "Close", handler: function() {}}]
        );
    }});

它在Android中运行得非常好。但是,在iOS设备中,服务器会更改并连接到新服务器。当自动更新运行以从更改的服务器获取新代码时,它会无限期地停留

非常感谢任何帮助。提前谢谢。

0 个答案:

没有答案