繁体   English   中英

MFP 8.0迁移| WL.Client.setHeartBeatInterval函数不起作用

[英]MFP 8.0 Migration | WL.Client.setHeartBeatInterval function not working

我从下面的URL下载了MFP 6.3示例项目,然后迁移到MFP 8.0

https://mobilefirstplatform.ibmcloud.com/tutorials/zh-CN/foundation/6.3/working-offline/working-offline/

function wlCommonInit(){    
    document.addEventListener(WL.Events.WORKLIGHT_IS_CONNECTED, connectDetected, false); 
    document.addEventListener(WL.Events.WORKLIGHT_IS_DISCONNECTED, disconnectDetected , false);
}

function connectionFailure(){
    alert("Could not connect to the MobileFirst Server.");
    var output = new Date() + "<hr />Working offline";
    $('#info').html(output);
}

function disconnectDetected(){
    var output = new Date() + "<hr />disconnectDetected";
    $('#info').html(output);
}

function connectDetected(){
    var output = new Date() + "<hr />connectDetected";
    $('#info').html(output);
}

function setHeartBeatInterval(interval){
    var output = new Date() + "<hr />heartbeat interval is set to: " + interval;
    $('#info').html(output);
    WL.Client.setHeartBeatInterval(interval);
}

WL.Client.setHeartBeatInterval函数。 但是在MFP 8.0中未触发WORKLIGHT_IS_CONNECTED, WORKLIGHT_IS_DISCONNECTED事件。

WL.Client.setHeartBeatInterval是否有效?

WL.Client.setHeartBeatInterval自MFP 8.0起有效,并且运行良好。API详细信息在此处

这些事件不再有效。 您可以添加自定义事件侦听器并检查连接性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM