I recently updated my Mac system from macOS 10.12.6 with Xcode 9.2 and iOS SDK 11.2 to macOS 10.13.6 with XCode 10.1 and iOS SDK 12.1 (cannot update to a more recent macOS right now).
My Ionic app was using UIWebView. Keyboard stopped working. When I restored the older macOS and rebuild Cordova, it worked again. But we all know UIWebView is deprecated so I started to migrate to WKWebView built against the newer iOS SDK. Keyboard still does not work. I tried and checked the following:
- Put
NSAllowsArbitraryLoads
inInfo.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
-
Adding
cordova-plugin-wkwebviewxhrfix
from https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix -
Editing the Cordova library source code, to replace the call to
loadFileUrl
method with loadRequest even for file:// URLs, as hinted at https://github.com/syrjs/core/blob/develop/ios/SyrNative/SyrNative/SyrBridge.m . It did not work, so I reverted the source.
Currently, with WKWebView, my start page is displayed in the simulator, but the virtual keyboard is not presented when I focus on a Text Box.
The following error messages are printed in iOS Simulator console:
Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
I added several log messages to Cordova to help diagnosing the problem.
Here are the messages I have :
2019-04-11 10:47:49.991695-0400 BosonTemplate.iOS[16125:667887] EchoPlugin: setting dataAccess static member
2019-04-11 10:47:50.958593-0400 BosonTemplate.iOS[16125:667887] Apache Cordova native platform version 4.3.1 is starting.
2019-04-11 10:47:50.958907-0400 BosonTemplate.iOS[16125:667887] Multi-tasking -> Device: YES, App: YES
2019-04-11 10:47:51.141996-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine initWithFrame allocate WKWebView
2019-04-11 10:47:51.271907-0400 BosonTemplate.iOS[16125:667887] [MC] Loaded MobileCoreServices.framework
2019-04-11 10:47:51.293306-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine eateConfigurationFromSettings start
2019-04-11 10:47:51.297622-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine enabling file XHR workaround
2019-04-11 10:47:51.297949-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine file XHR workaround enabled
2019-04-11 10:47:51.298151-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine pluginInitialize re-create WKWebView
2019-04-11 10:47:51.303199-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine will reload WKWebView if required on resume
2019-04-11 10:47:51.303413-0400 BosonTemplate.iOS[16125:667887] Using WKWebView
2019-04-11 10:47:51.303802-0400 BosonTemplate.iOS[16125:667887] CDVHandleOpenURL pluginInitialize
2019-04-11 10:47:51.304012-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][handleopenurl] 237942ms
2019-04-11 10:47:51.306159-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][intentandnavigationfilter] 1.989007ms
2019-04-11 10:47:51.306392-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][gesturehandler] 0.064015ms
2019-04-11 10:47:51.351301-0400 BosonTemplate.iOS[16125:667887] WARNING: The splashscreen image named Default-667h was not found
2019-04-11 10:47:51.351576-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][splashscreen] 45.016050ms
2019-04-11 10:47:51.355719-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][statusbar] 3.841043ms
2019-04-11 10:47:51.358979-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][keyboard] 2.917886ms
2019-04-11 10:47:51.359489-0400 BosonTemplate.iOS[16125:667887] [CDVTimer][TotalPluginStartup] 55.716991ms
2019-04-11 10:47:51.360168-0400 BosonTemplate.iOS[16125:667887] Gave lock 1
2019-04-11 10:47:51.360417-0400 BosonTemplate.iOS[16125:667887] User-Agent set to: Mozilla/5.0 (iPhone; CPU iPhone OS 11_1 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B87 (140435630678000)
2019-04-11 10:47:51.360872-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine loadRequest file URL start file:///Users/mrener/Library/Developer/CoreSimulator/Devices/6956F8FB-C069-4D40-8883-C4B51A10B933/data/Containers/Bundle/Application/C466B8C9-8ED2-4EB9-A074-7FBA485D1E60/BosonTemplate.iOS.app/www/index.html
2019-04-11 10:47:51.361063-0400 BosonTemplate.iOS[16125:667887] CDVWKWebViewEngine loadRequest before WKWebView loadFileUrl
2019-04-11 10:47:51.388896-0400 BosonTemplate.iOS[16125:667887] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2019-04-11 10:47:51.391093-0400 BosonTemplate.iOS[16125:667887] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
19-04-11 10:47:54.106030-0400 BosonTemplate.iOS[16125:667887] Released lock 1
2019-04-11 10:47:54.106260-0400 BosonTemplate.iOS[16125:667887] CDVHandleOpenURL cold-start handler
What can I no next?