如何为MFP v8调用WL.client.init API

时间:2017-04-14 06:13:08

标签: ibm-mobilefirst

我将我的cordova应用程序升级到MFP v8最新的iFIx(8.0.0.00-20170220-1900),现在我无法从我的cordova应用程序连接到MFP。

在Xcode中,我看到了错误

WebKit discarded an uncaught exception in the 
webView:didFinishLoadForFrame: delegate: <Illigal API call> IBM

MobileFirst Platform framework is not initialized. [WL mainHtmlFilePath] 

API should be used after the successful callback of the 
[WL initWithDelegate:] 
API. This is to ensure that IBM MobileFirst Platform framework 
initialization is complete and web resources are ready to be used.

这是我的通话片段

try {
  WL.Client.init(wlInitOptions);
} catch (err) {
  console.error('MFP: "WL" init error - ' + err);
  initFailure(err);
}
var wlInitOptions = {
timeout: 1000,
onConnectionFailure: initFailure,
onFailure: initFailure,
onSuccess: function () {
    console.log('MFP: Loaded');
    initDeferred.resolve();         
    connectToMobileFirst();
 }
};

永远不会调用onSuccess或Failure方法。

感谢您的帮助

0 个答案:

没有答案