The MobileFirst framework is initialized in the iOS platform to display a WebView in the Cordova app with MobileFirst.
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
@autoreleasepool
{
int retVal = UIApplicationMain(argc, argv, nil, @"MFPAppDelegate");
return retVal;
}
}
The MFPAppDelegate.m file is found in the plugins folder. This replaces the default Cordova AppDelegate.m file and initializes the MobileFirst framework before the view controller loads the WebView .
The didFinishLaunchingWithOptions method initializes the framework:
[[WL sharedInstance] initializeWebFrameworkWithDelegate:self];
Once the initialization succeeds the wlInitWebFrameworkDidCompleteWithResult checks that the MobileFirst framework has been loaded, invokes wlInitDidCompleteSuccessfully and creates listeners for receiving data (see MobileFirst Cordova plug-in initialization for analytics. The wlInitDidCompleteSuccessfully creates a cordovaViewController that connects to the default index.html page.
Once the iOS Cordova app is built in Xcode without errors, you can proceed to add features to the native platform and WebView.