Cordova ios build results in black screen

I finally got back to iOS development, and had to revisit this thread to get it working again:sweat_smile:
I also discovered another couple of tweaks that I think most everyone making an iOS game will want to add:

  • Auto hide the “home bar” at the bottom of the screen:
cordova plugin add cordova-plugin-hide-home-indicator

To me that was pretty critical from a UX perspective in a game. It still shows up if you touch near the middle bottom of the screen, but it does fade away now instead of always being there. If you have an older iOS device with a physical home button you might not be familiar with this, but your users will!

  • Hide the status bar (time/battery/cellular/wifi)
    You can add this to your config.xml:
<edit-config file="*-Info.plist" target="UIStatusBarHidden" mode="merge">
    <true/>
</edit-config>
<edit-config file="*-Info.plist" target="UIViewControllerBasedStatusBarAppearance" mode="merge">
    <false/>
</edit-config>

In summary here here are all the modifications I found necessary to add to the generated config.xml when you export to "Android & iOS (Manual Build) in GDevelop:

    <plugin name="cordova-plugin-screen-orientation" version="3.0.2" />
    <plugin name="cordova-plugin-hide-home-indicator" spec="1.0.*" />
    <preference name="orientation" value="landscape" />
    <preference name="allowFileAccessFromFileURLs" value="true" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <preference name="AllowsAirPlayForMediaPlayback" value="false"/>
    <edit-config file="*-Info.plist" target="UIStatusBarHidden" mode="merge">
        <true/>
    </edit-config>
    <edit-config file="*-Info.plist" target="UIViewControllerBasedStatusBarAppearance" mode="merge">
        <false/>
    </edit-config>
2 Likes