State of WKWebView on Cordova iOS 9? - ios

iOS 8 introduced WKWebView, a modernised web view for iOS with more features, particularly notably JIT compilation for Javascript code which significantly improves performance.
However WKWebView on iOS 8 had some bugs which prevented Cordova using it by default. AFAIK there are plugins that can use it, but they all say "beta", "incomplete" etc. Also as far as I'm aware iOS 9 fixes the bugs that stopped Cordova defaulting to WKWebView in iOS 8.
So what is the state of WKWebView in Cordova on iOS 9? I can't seem to find any information about this. Does Cordova default to WKWebView on iOS 9? If not why not, and can it be officially enabled another way?

New edit: June 2019
Apple has not removed UIWebView in iOS 13 beta, so looks like it can be used at least for another year.
Ionic WebView plugin, starting in version 3.0.0 no longer uses a web server, but the WKURLSchemeHandler instead, that required to drop support for iOS 10 and older.
Still backport most fixes to 2.x branch that still have the web server for those that want to support iOS 10.
WKWebView was not integrated into cordova-ios 5.0.0, a plugin is still required to use it. Should be there for 6.0.0 version.
And now there is Ionic Capacitor available, an Apache Cordova alternative that was built with the WKWebView since the beginning. It has its own set of plugins, but it's also compatible with most Cordova plugins.
https://capacitor.ionicframework.com/
Old edit: August 2018
Apple has deprecated UIWebView in iOS 12 and will probably remove it in iOS 13.
Apache Cordova has announced that it will integrate the cordova-plugin-wkwebview-engine into cordova-ios in next major release (5.x.x), but UIWebView will still work and be the default one. Also, you'll be able to switch between them in runtime to easily test your app.
In a future release it will remove the whole UIWebView code and the WKWebView will be the only option.
But cordova-plugin-wkwebview-engine still have a lot of issues. I still recommend using cordova-plugin-ionic-webview as using GCDWebServer solves most of the WKWebView issues.
New edit: November 2017
Ionic team has launched a new WKWebView plugin that is no longer a fork of the Cordova one and uses GCDWebServer internally and overcomes most of the Cordova plugin known issues.
New edit: 24 August 2016
Updated just to add a fork of the apache's WKWebView plugin created by the ionic framework team that adds some enhancements to the plugin.
https://github.com/driftyco/cordova-plugin-wkwebview-engine
The enhancements will probably land on the core plugin soon, but you can take a look and test the ionic fork now.
New edit: 9 December 2015
cordova ios 4.0.0 has been released
and the version 1.0.0 of cordova-plugin-wkwebview-engine
To try it:
cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add ios#4
cordova plugin add cordova-plugin-wkwebview-engine
As I already told, cordova-plugin-wkwebview-engine only supports iOS 9, on iOS 8 it will use UIWebView and has some know issues
If you want to support iOS 8 too, you can use the wkwebview-engine-localhost (experimental) or cordova-plugin-wkwebview from Telerik, both of them use a local web server
https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost
OLD MESSAGE:
You can use WKWebView with cordova using the WKWebView plugins available.
The problem you mention is that WKWebView can't load local files, so the plugins use a local web server to workaround the problem.
There are some of them like this one from telerik https://github.com/Telerik-Verified-Plugins/WKWebView (with the web server built in) or the official from cordova team https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost (with the web server as dependency plugin)
As the bug you mention is fixed on iOS 9, the current cordova plugin (compatible with iOS 8 and iOS 9, using the web server) has been renamed to wkwebview-engine-localhost, and the current name cordova-plugin-wkwebview-engine will be used for a new plugin that will support iOS 9 only and won't use the web server
You can see the issues to track the progress here
https://issues.apache.org/jira/browse/CB-9566
https://issues.apache.org/jira/browse/CB-9567
EDIT: I bring news https://shazronatadobe.wordpress.com/2015/09/09/apache-cordova-ios-4-0-0-and-wkwebview-support/
WKWebView support
The cordova-plugin-wkwebview-engine plugin will be iOS 9 only and it
will be a core plugin. The development of this updated plugin is still
in progress. Apple has fixed the bug where we couldn’t load documents
from file:// urls, and it is iOS 9 only. On non-iOS 9 devices,
cordova-ios will fallback to using the UIWebView.
The old version of this plugin used a local webserver to load your
main document. This older plugin can be used where you want to use
WKWebView in both iOS 8 and iOS 9 deployments, but the plugin will
remain as a cordova-labs experiment. This plugin has some re-factoring
work to be done.

Related

How to upload Old Cordova iOS App to the App Store with WKWebView

Cordova iOS is giving me a very hard time. I have a Cordova iOS app written in 2016 and I am handling it now.
I believe you are familiar with the following app store issues regarding UIWebView:
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted.
Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
Now my application is quite huge; it has Apple Pay feature, biometrics, lots of bridge calls between website and iOS app.
I tried to update Cordova in my app and then uploaded it, but it never worked. So I find out that first the physical structure of my app was wrong, all I had in my source tree is 'src' folder which had everything. So I created "hello world" Cordova iOS project from terminal (command line) and then noticed the difference of folders and files like config.xml hooks, nodeModules etc ..
Now my solution was to create a sample helloworld app and then copy my code into ios folder (platform->iOS-> My 100 files). But it did work. I followed this link: https://github.com/apache/cordova-plugin-wkwebview-engine
And i thought if i follow following lines of code in terminal :
cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add ios#4
cordova plugin add cordova-plugin-wkwebview-engine
I will create a Cordova app which will have ios 4 version of Cordova and then WKWebView will be integrated in my app and then i will be able to upload this app on app store.
But even this sample application gives me app store error of deprecated UIWebView. Has anyone found the clear cut solution to this problem?
Q1: Have you ever uploaded a sample test app like hello world to the TestFlight which has Cordova ios 4.1+ or even cordova ios 5.1+ version. Because I am assuming in Cordova wkwebview plugin all things related to uiwebview has already been handled or atleast in the latest version it has been handled and we don't need to do anything else apart from installing latest Cordova ios version.
Question 2: What should I do to upload my app on app store it has cordova-ios 4.1.1 right now. I tried many possible ways. Like for eg a) created a sample cordova-ios app with latest Cordova ios 5.1.1 and copied all my source files (almost 100-500) into ios folder, removed all uiwebview instance in my code (almost 50 places), but when I search for 'uiwebview' cordova library still has almost 120 search results.

Cordova + Crosswalk iOS still using UIWebView

I didn't find a lot of instruction setting up crosswalk for iOS it seems like it should be as simple as:
cordova plugin add cordova-plugin-crosswalk-webview
cordova build ios
Because I've had issues with plugins not taking effect before I do the following:
cordova plugin add cordova-plugin-crosswalk-webview
cordova platform remove ios
cordova platform add ios
cordova build ios
After having done this, when I capture the view hierarchy and inspecting that it's still using "UIWebView" which has a "UIWebBrowserView" inside of it (which is inside of a scroll view and there are a couple image views too).
Also, navigator.userAgent is as follows:
"Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13B143 (5618403776)" = $1
Another test someone mentioned was essentially:
if (window.indexedDB)
console.log('Using crosswalk');
else
console.log('Not using crosswalk/wkwebview');
And window.indexedDB is undefined.
So... what do I need to do so that the app uses wkwebview?
A review of the plugin repository does NOT indicate a cordova-plugin-crosswalk-webview that supports iOS. This means crosswalk does not work as a plugin for iOS.
Yes there is support for Crosswalk for iOS, but you must install via the github repository or other means.
Cordova Embedding WebViews
FWIW: there is a WkWebview plugin
UPDATE: 2016-03-19. The follow post was made on February 16, 2016:
Plugins From Git Repositories Are Now Available on PhoneGap Build!
How I solved the issue
As JesseMonroy so helpfully answered(feel free to upvote him) the cordova crosswalk plugin is only for android.
Because of apple's terms of service, crosswalk for iOS uses wkwebview instead of what non-ios version of chrome would use.
Since there is no cordova plugin I know of for crosswalk iOS, I found plugins for WKWebView
The plugin I used was:
https://github.com/Telerik-Verified-Plugins/WKWebView
This is probably a better option: https://github.com/apache/cordova-plugin-wkwebview-engine.. But it errored for me.
Coming soon:
As stated by Honry:
Crosswalk will soon provide a cordova plugin for Crosswalk ios, see
ticket https://crosswalk-project.org/jira/browse/XWALK-4911
XWalk will not be supporting an iOS plugin afterall because it does not provide any must have advantages over wkwebview
Crosswalk will soon provide a cordova plugin for Crosswalk ios, see ticket https://crosswalk-project.org/jira/browse/XWALK-4911

robovm binding admob iOS libgdx

I'm trying to set up my admob ads in my iOS libgdx project but i can't see no ads on iOS emulator I'm using the files from here https://github.com/BlueRiverInteractive/robovm-ios-bindings
and they are the latest i know there is 7.0.0 admob iOS sdks but the binding are for lower version that suppose to work... or not?
any idea?
or i might shall use different adnetwork?
<Google:HTML> You are currently using version 6.12.2 of the SDK, which doesn't officially support iOS 8. Please consider updating your SDK to the most recent sdk version, 7.0.0, to get iOS 8 support, including a fix for smart banner rendering in landscape mode. The latest SDK can be downloaded from http://goo.gl/iGzfsP. A full list of release notes is available at https://developers.google.com/mobile-ads-sdk/docs/admob/ios/rel-notes.
2015-03-22 10:41:59.822 IOSLauncher[12856:751391] [debug] com.funkymonkey.game.IOSLauncher: didReceiveAd
2015-03-22 10:42:30.217 IOSLauncher[12856:751391] [debug] com.funkymonkey.game.IOSLauncher: didReceiveAd
I came across the same problem too. First I downloaded the newest iOS sdk for google mobile ads. Then I made a static library in Xcode. Then created my own bindings.

How to deploy xamarin ios app with SDK Version 5.0 to use old theme (not iOS 7 Theme) in visual studio 2013

Hello everyone I have a legacy xamarin.iOS project (built with 5.0 SDK) now i need to update some things without changing the look of the app.
After some research how to get the older SDKs to show up in the SDK Version dropdown in Visual Studio 2013 I finally got to select the 5.0 SDK (I also changed the Deployment Target to 5.0)
But when I deploy the app to my iPhone 5S running iOS 7.1.1. i get the iOS 7 Theme
Is there any way to get the app to use the old theme? (If I download the app from the store it works with the old theme, so there should be some way)
By the way on my research I read this article Using iOS 6 theme for iOS 7 app
Is it true that I cant upload apps using an older SDK? Even for app updates?
Thanks in advance for any help.
Submission to the Apple store requires that the product be compiled with the most recent released Tools (Xcode 5.1.1 at this point) and compiled with the most recent SDK (Currently 7.1)

How to conditionally load plugins in PhoneGap / Cordova

I have an app built on Cordova 3.3 running this phonegap-estimote plugin.
All works great on iOS 7 devices, but will crash on startup for any version previous.
I've tried using window.device.version on DeviceReady to bypass calls related to the plugin, but I think the app crashes on plugin initialization.
So my question: is there a way to conditionally load a plugin or prevent it from initializing?
This is Wojtek Borowicz, I'm a community evangelist in Estimote.
Please note that Estimote SDK, for which the referenced PhoneGap plugin was built, is only compatible with iOS 7. You can however set some code within your libraries and the CoreLocation from 'required' to 'optional'

Resources