【发布时间】:2015-04-06 20:28:10
【问题描述】:
我的 IBM Mobilefirst 应用程序在启动时连接到服务器。当我尝试在离线模式下打开应用程序时,它会显示一个警报,其中包含 “应用程序无法连接到服务”,并带有 3 个按钮:“重新加载”、“关闭”和“详细信息”。
如何在应用离线时禁用此警报?我试过不打电话给WL.Client.connect,但没有用。处理这个问题的正确方法是什么?
从离线模式登录:
04-06 15:54:21.578: E/NONE(16221): [/apps/services/api/app1_worklight/android/logout] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.
04-06 15:54:21.588: E/NONE(16221): Client init failed. The service is currently not available.
【问题讨论】:
-
你能提供日志吗?尝试在 initoptions.js 中实现 onConnectionFailure 方法来捕获 MF API 失败。阅读以下问题Server Connecting Issue