Game fails to launch with iOS 10 + Cordova

Discussion and feedback on Construct 2

Post » Fri Sep 16, 2016 3:49 pm

A game that passed App Review a few weeks ago has ended up being unplayable once users upgrade to iOS 10. After the splash screen, there is just a black screen and nothing appears to load. Has anyone experienced this and found a workaround?

I've stripped everything down to the most basic C2 project I could: a single layout with one "Hello, World" text object. This issue is consistently reproducible for me with Cordova 6.3.1 and iOS platform 4.2.1. C2 is latest stable r233.

Steps:
$ cordova create testapp com.mycompany.testapp testapp
$ cd testapp
$ cordova platform add ios --save
(Copy any exported C2 project to "www" folder)
$ cordova prepare ios

Running on an iOS device or in simulator gives the black screen and in the logs there is only a message like:

Code: Select all
Finished load of: file:///var/containers/Bundle/Application/3D48F237-F760-4F33-A08E-4A113A576B05/testapp2.app/www/index.html


Running on an iOS 9.3 device it still works as expected.

Further, building the app with a simple non-C2 web app appears to launch as expected on device and in the simulator.

I found suggestions of adding an appropriate Content-Security-Policy tag to index.html, and have tried this with no success. What other configuration might be necessary to get the game to run on iOS 10, that I could have overlooked and was not strictly necessary on iOS 9?
B
5
Posts: 7
Reputation: 239

Post » Fri Sep 16, 2016 11:13 pm

I am having the exact same issue and my app is for sale. I just started over as well. My app worked fine as well before. It is a $.99 app, so this is very challenging. I may have to pull it.
B
19
S
3
G
1
Posts: 22
Reputation: 1,699

Post » Fri Sep 16, 2016 11:30 pm

Another update. I did as you did with a different app. I built an old impactJs project I had from years ago and it runs fine on Cordova/OSX 10.

This seems isolated to construct2 exports for Cordova based on the cordova apps that i have.
Last edited by Guinness on Sat Sep 17, 2016 1:20 pm, edited 1 time in total.
B
19
S
3
G
1
Posts: 22
Reputation: 1,699

Post » Fri Sep 16, 2016 11:57 pm

Give this a try > http://stackoverflow.com/questions/3841 ... os-10-beta < -- I've searched various forums, including the Cordova project, and am not finding anything specific, other than the link that I just gave you which recommends an update to the CSP tag in your index.html file. Also, this response on the PhoneGap Build forum > https://forums.adobe.com/message/8985487#8985487 < from "kerrishotts" has some useful info.
Intel Corporation
B
13
S
3
Posts: 79
Reputation: 925

Post » Sat Sep 17, 2016 1:34 am

I am having same problem. My game on the app store stops working if the player upgrades to iOS 10. I also tried adding the CSP tag with no luck. Hope this is resolved ASAP or I just may move to Cocoon.io as many others have.
B
42
S
16
G
3
Posts: 169
Reputation: 4,383

Post » Sat Sep 17, 2016 8:39 am

I'd already seen the recommendation to add the CSP tag but it did not help. Also, it's not necessary to get non-C2 apps to launch.
B
5
Posts: 7
Reputation: 239

Post » Sun Sep 18, 2016 12:38 am

I've made a little progress. I moved some of the settings from the config.xml file to the platform/ios/app/config.xml file but kept the intent tags. The app does load now.

I did not add the CSP tag to index.html. I basically just merged the config.xml files. I don't know exactly what should be happening there, but without the content in both of those files, the app will not start.
Below is what it looks like. I know the general intent with wild card is very open, but I am just trying to get this going right now.

I'll post more as I get to everything working.

Code: Select all
(working config posted below)
Last edited by Guinness on Sun Sep 18, 2016 2:44 pm, edited 1 time in total.
B
19
S
3
G
1
Posts: 22
Reputation: 1,699

Post » Sun Sep 18, 2016 3:00 am

@Guiness Where is platform/ios/app/config.xml? Thanks.
B
42
S
16
G
3
Posts: 169
Reputation: 4,383

Post » Sun Sep 18, 2016 5:25 am

I am not 100% sure if the config.xml files get combined when building. So, I just took the contents from the config.xml file that Construct2 creates and put them into the config.xml file that cordova creates when generating the app. I think all of these settings need to be in the same file.

Thats the file you are asking about. In the cordova project, it is just one level above the www folder. So it would be :
[app folder]\config.xml
[app folder]\www
[app folder]\platforms
etc

I just put all of the configs in the config.xml at the top level. When building cordova will pull in all of the plug ins that you need. Below is what my file looks like. There were several things that I needed because of the the plugins I have and things that are needed. It is not recommended to have the intent entries with the wildcard, but I'm just getting this working again. This does work without any changes in the construct.

Its just combining the export config from construct with the config that cordova creates. Putting the security policy entry in the index.html file actually prevented the app from working . I did try that with wide open options. This is just what I've found. I'm not a cordova expert but at least its up and running again.

config.xml
Code: Select all
<?xml version='1.0' encoding='utf-8'?>

<widget id="com.rggames.mathfactchallenger" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
   
    <name>MathFactChallenger</name>
    <description>
        Math Fact Challenger - practice math facts!
    </description>
    <author email="[email protected]"
        href="http://mathfactgames.net">
        Math Fact Games
    </author>
    <plugin name="cordova-plugin-whitelist" source="npm" />
    <access origin="*" />
    <allow-intent href="*" />
    <allow-navigation href="*" />

    <preference name="orientation" value="default" />
    <preference name="fullscreen" value="true" />
    <gap:config-file platform="ios" parent="UIStatusBarHidden"><true/></gap:config-file>
    <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance"><false/></gap:config-file>
    <preference name="AllowInlineMediaPlayback" value="true"/>
    <preference name="BackupWebStorage" value="local"/>
    <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
   
   
    <plugin name="cordova-plugin-wkwebview-engine" source="npm"/>
    <plugin name="cordova-plugin-file" source="npm" />
    <plugin name="cordova-plugin-media" source="npm" />
    <plugin name="cordova-plugin-inappbrowser" source="npm" />
    <plugin name="cordova-plugin-canvas2image" source="npm" />
   
   
</widget>
B
19
S
3
G
1
Posts: 22
Reputation: 1,699

Post » Sun Sep 18, 2016 12:35 pm

Are you editing files before or after "cordova prepare ios"? Which line(s) in your config.xml above made the difference?
B
5
Posts: 7
Reputation: 239

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests