2017-08-23 3 views
0

を働いていない私は、以下のURLからMFP 6.3サンプルプロジェクトをダウンロードして、関数が呼び出されるMFP 8.0にMFP 8.0移行| WL.Client.setHeartBeatInterval機能

https://mobilefirstplatform.ibmcloud.com/tutorials/en/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を移行しました。しかし、WORKLIGHT_IS_CONNECTED, WORKLIGHT_IS_DISCONNECTEDイベントはMFP 8.0ではトリガーされません。

WL.Client.setHeartBeatIntervalは仕事ですか?

答えて

0

は、MFP 8.0以降で有効です.APIの詳細はhereです。

イベントはもう有効ではありません。カスタムイベントリスナーを追加して、接続性をチェックできます。

関連する問題