I build Cordova application that has cordova-plugin-mfp plugin(IBM Mobile First Platform 8). But this application crashed when started.
I guess cordova-plugin-mfp has problem in 'bootstrap.js'. WL.Client.init can be called before initialize (WL.Client == undefined).
// plugins/cordova-plugin-mfp/bootstrap.js
function mfpready (){
mfpFire();
//call WL.Client.init unless user defined mfpClientCustomInit = true in config.xml, and propagated to static_app_props.js
if(WL.StaticAppProps && !WL.StaticAppProps.mfpClientCustomInit){
console.log('Calling WL.Client.init(wlInitOptions);')
var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions : {};
WL.Client.init(options);
} else {
console.log('Developer will call WL.Client.init manually');
}
//Inform developer they should load their own jquery and not use MFP internal version
deprecateWLJQ();
}
So I add this element to config.xml
<mfp:clientCustomInit enabled="true" />
and add the event handler in my application code(below).
document.addEventListener('mfpjsloaded',
function() {
WL.Client.init(wlInitOptions);
},
false);
I'm searching better workaround or patch for this problem.
Can anyone tell me any advice?
My environment
- OS: Window 10 Pro 1607
- Cordova : 6.5.0
- nodeJS : 6.10.3
- VS : Visual Studio 2015 Update 3
- cordova-windows : 4.3.2
- cordova-plugin-mfp : 8.0.2017033009