WKWebView support for iOS appsimprove this page | report issue
You can replace the default UIWebView in your MobileFirst hybrid iOS Cordova app with WKWebView.
About this task
With the latest iFix release IBM MobileFirst Platform Foundation V7.1.0 (IF201905221643), you can integrate WKWebView with your hybrid iOS Cordova MobileFirst app.
The cordova-ios version has been updated to 4.0.1 in this iFix release. Ensure that any additional third-party cordova plugin that is added to the project is compatible with the cordova-ios version 4.0.1.
WKWebView provides an improved WebView. WKWebView displays interactive web content, such as for an in-app browser.
To enable the WKWebView in a Hybrid MobileFirst app for iOS, follow the below steps.
- Open the MobileFirst Hybrid iOS application in Xcode IDE (
- Navigate to the
Resources/config.xmlfile and add the following preference under the <widget> tag.
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
- Click Build phases > Link Binary with Libraries > Search for Webkit.framework and add it.
- Click CordovaLib.xcodeproj > Build Phases
- Add the following header files in the Headers tab as public. These files are located in
- Add the following source files in Compile sources tab. These files are located in
- Clean and Rebuild the application.
Your MobileFirst hybrid app now uses the WKWebView component instead of the default UIWebView component.▲
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on June 20, 2019