从客户端进行Mobile First Server 8.0连接检查

时间:2018-05-08 03:54:27

标签: ibm-mobilefirst mobilefirst-server

需要检查MFP服务器是否启动并运行,如果服务器无法访问,则需要提醒用户系统已关闭。

我使用了以下代码

renderer.listen('document', 'mfpjsloaded', () => {
  WLAuthorizationManager.obtainAccessToken("").then(
  function(accessToken) {
    console.log("MFP Server is up and running");       
 },
 function(error) {
   console.log("MFP Server is not reachable");
 }
);

});

但是app会抛出 Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

0 个答案:

没有答案