I am testing developing a Hybrid application in MobileFirst Studio and want to connect to MobileFirst Server during the app init. I updated main.js file under MF_Project/app/[appNanme]/common/js/main.js init method with the following:
WL.Client.connect({
onSuccess: function() {
WL.Logger.info("onSuccess: connection success");
},
onFailure: function(err) {
WL.Logger.info("onFailure: Exception: " + err);
}
});
I then build the app for Android environment (right click the appName the one under MF_Project and select "Build for Android environment"). Then I ran the app as Android Application in emulator, but the log comes back with error
01-25 16:04:29.364: E/NONE(2755): Invalid invocation of method WL.Client.connect; Invalid value 'undefined' (undefined), expected type 'function'.
01-25 16:04:29.368: E/NONE(2755): Invalid invocation of method WL.Client.connect; Invalid options attribute 'onSuccess'. Invalid invocation of method WL.Client.connect; Invalid value 'undefined' (undefined), expected type 'function'.
Any insight on this would be appreciated.