需要检查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)