Update on Cordova apps on iOS 10

Discussion and feedback on Construct 2

Post » Thu Sep 22, 2016 12:51 pm

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
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Thu Sep 22, 2016 3:30 pm

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.....
B
7
S
1
Posts: 16
Reputation: 469

Post » Fri Sep 23, 2016 7:54 am

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.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
64
S
18
G
90
Posts: 1,118
Reputation: 59,565

Post » Fri Sep 23, 2016 5:21 pm

In c2runtime.js replace:
this.isWKWebView = !!(this.isiOS && this.isCordova && window.indexedDB);
With:
this.isWKWebView = false;
B
10
S
3
Posts: 51
Reputation: 764

Post » Fri Sep 23, 2016 5:54 pm

@COGames - that will then break WKWebView!
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Mon Sep 26, 2016 5:39 pm

@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.
B
28
S
11
G
15
Posts: 47
Reputation: 9,533

Post » Mon Sep 26, 2016 7:27 pm

@caad8user - are you able to file a bug report for that?
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Mon Sep 26, 2016 11:37 pm

@ashley I'll put up a bug report on it.
B
28
S
11
G
15
Posts: 47
Reputation: 9,533

Post » Tue Sep 27, 2016 10:05 am

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 :) :) :)
B
3
S
1
Posts: 4
Reputation: 333

Post » Tue Sep 27, 2016 11:27 am

@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.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Next

Return to Construct 2 General

Who is online

Users browsing this forum: purplemonkey, Studio Mercato and 2 guests