【发布时间】:2025-11-26 02:20:12
【问题描述】:
我想实现这样的功能。 那是: 1) 成功连接worklight服务器的情况下,可以直接更新。 2) 在连接worklight服务器失败的情况下,应用可以离线运行。
下面是我在“initOptions.js”中的配置。
// # Should application automatically attempt to connect to Worklight Server on application start up
// # The default value is true, we are overriding it to false here.
connectOnStartup : true,
// # The callback function to invoke in case application fails to connect to Worklight Server
onConnectionFailure: function (){
alert("onConnectionFailure");
doDojoReady();
},
// # Worklight server connection timeout
timeout: 10 * 1000,
// # How often heartbeat request will be sent to Worklight Server
heartBeatIntervalInSecs: 20 * 60,
// # Should application produce logs
// # Default value is true
//enableLogger: false,
// # The options of busy indicator used during application start up
busyOptions: {text: "Loading..."
但它不起作用。 有什么想法吗?
【问题讨论】:
-
我正在使用 Worklight 版本:5.0.5。当网络可用时,直接更新工作正常;但是离线时,我的应用程序无法运行。
标签: ibm-mobilefirst