0 Favourites

Update on Cordova apps on iOS 10

  • Hi all,

    We've had some reports that some Cordova games just show a black screen on iOS 10. Initial investigation indicates this is because a breaking change in iOS 10 is making UIWebView apps think they are actually WKWebView. However WKWebView apps appear to still work fine.

    Consequently you should be able to work around this simply by enabling WKWebView. (Note on the Intel XDK, you must also use the new project format for it to take effect.) This has been on by default for a while now IIRC. We managed to iron out most of the problems and support all features (including, eventually, video), and more importantly WKWebView is significantly faster. So there is a strong case to enable it anyway, regardless of this issue.

    Apple have made it virtually impossible to detect from Javascript if it's running in UIWebView or WKWebView. Unfortunately this means there isn't any immediately obvious way to fix this problem. We may need to get a change made in Cordova, which could take a few months to happen.

    One solution is simply to drop support for UIWebView. This would mean only supporting iOS 9+, but it's already at 88% share and will probably soon jump up further as iPhone 7 sales (shipping with iOS 10) replace older devices. The positive side is it means all exported Cordova iOS apps benefit from improved performance.

    We'll continue looking in to our options here, but it would be useful to know:

    • is there a reason you aren't using WKWebView already? (maybe specific bugs, features etc)
    • is it important to you to support iOS 8 and older?

    Thanks for your patience, hopefully we will sort this out soon!

    • Ashley
  • I might not be the best person to comment here since I have no apps on iOS (I will one day...)

    That said: 88% is great! With the iPhone 7 coming it will probably be 90% or 95%... That's a huge percentage!

    But you posed nice questions. Let's see if anyone has any valid points.....

  • Well a few months won't hurt.... Many people I know including relatives only own IOS 9 devices and as far as I i know neither of them are planning on upgrading to IOS10 unless they buy Iphone 7.

  • In c2runtime.js replace:

    this.isWKWebView = !!(this.isiOS && this.isCordova && window.indexedDB);

    With:

    this.isWKWebView = false;

  • COGames - that will then break WKWebView!

  • Ashley I have 2 games in the App Store but I have to disable WKWebView (using Intel's XDK instructions "... this.WKWebView = flase;" method). I don't get the blank screen when I deploy my games on WKWebView to the appstore. But after the menu screen, they just freeze and main game doesn't load. So even with the new Construct 2 beta, still happens and I don't know why.

    My point is, I'm not sure if I'll be affected (or probably give me a huge headache) if C2 drops UIWebView support.

  • caad8user - are you able to file a bug report for that?

  • Ashley I'll put up a bug report on it.

  • Hello,

    I have downloaded the new beta release r236 and have exported the project with Cordova. But I'm still getting a black screen on intelXDK when simulating the app on iOS.

    While the project works great on Android, it doesn't seem to work at all on iOS. To make sure that the problem was not coming from my project, I have even exported a Template project of Construct and I'm still getting the black screen.

    I have tested the project on my iPhone 6 (ios10) to make sure it wasn't just a simulation problem but it also shows a black screen. And shows this message "Error feching data.js". On my iPadAir (ios9) loads without problems.

    I would appreciate if you could please help me solve this problem

  • annerosas - please file a bug report following all the guidelines, we can't help without all that information.

    However if you somehow build without WKWebView when it's exported to use WKWebView, you would see that error, so maybe check your build settings.

  • I have the same issue. exported new project in intel -> ipad 9 and get a white screen about 10secs after the game start

  • cristiart - please file a bug following all the guidelines so we can investigate.

  • Hi,

    I'm also struggling with iOS 10 & Cordova (+cocoon.io & cocooncanvasplus plugin)

    When I do a simple cordova export, my app only displays a blank screen on iOS 10 (but works on iOS 8 & 9)

    If I change this in c2runtime.js

    this.isWKWebView = !!(this.isiOS && this.isCordova && window.indexedDB);

    to:

    this.isWKWebView = false;

    My app is working on iOS 10, but then the screen scale is displayed incorrectly

    http://i.imgur.com/uUOixFs.png

    My project settings:

    http://i.imgur.com/zwMD3lw.jpg

    (using C2 r233 64bits)

    I'm not sure how to enable WKWebView, should I just check the box in the Cordova export option ?

    Should I also change the line in c2runtime.js to this.isWKWebView = true; ?

    Do I have anything to do with Cocoon ?

    Or is there any other way to make my app working correctly without WKWebView on iOS 10 ?

    Thank you

  • johnsmith - note the non-webview Cocoon platforms have been deprecated for a long time now so have not been supported for some time. I don't know if that's what you're using?

    Anyways, it turns out there's another obscure property we can rely on to detect WKWebView. Apparently Cordova detects it the same way, so if iOS 11 breaks it, it will break all Cordova apps, not just our own Hopefully that is good enough for the future. So the next build actually brings back the "enable WKWebView" and "use new Intel XDK project format" options. I still strongly recommend using WKWebView where possible, since it is significantly faster!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • johnsmith - note the non-webview Cocoon platforms have been deprecated for a long time now so have not been supported for some time. I don't know if that's what you're using?

    I'm not using the old cocoon exporter since it's been deprecated, the new cocoon.io only requires a Cordova export from C2 along with the appropriate cocoon plugins in the project (which can be found here: https://github.com/CocoonIO/cocoon-plugins-c2 ).

    In the cocoon.io compiler, I'm using the webview engine: Canvas+ (and so the CocoonCanvasPlus plugin in my C2 project)

    http://docs.cocoon.io/article/webview-engines-differences/

    Is my screen scaling problem when WKWebview is disabled more related to Cocoon than Construct 2 (or Cordova) ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,235
FlyingRam's avatar
FlyingRam
Unread hot topic
1,068 148,637
Reflextions's avatar
Reflextions
Unread hot topic
0 Favourites
CocoonJS plugin updates
519 48,574
tuzke's avatar
tuzke