How to Disallow Skillz From Exiting

By default, a user can exit the Skillz UI via the sidebar menu. This is commonly for games that allow their users to play it without having matches via the Skillz platform. If your game will not have such an option, then continue reading this article for instructions on how disallow Skillz from exiting.

iOS

First, make sure the game has been exported to an Xcode project. Next, open the Xcode project and open the Skillz+Unity.mm file. There should a call to the initWithGameId method that has an allowExit argument. Change its value from YES to NO. For example:

Screen_Shot_2019-05-13_at_2.46.46_PM.png

Build and run the game as usual. The option to exit the Skillz UI should no longer be available from the sidebar menu.

Android

For Android, the file called AndroidManifest.xml will be modified. This can be accomplished either by modifying it from the game’s Android Studio project (after it has been exported), or directly from the Unity editor before exporting to an Android Studio project.

Android Studio Project

First, make sure the game has been exported to an Android Studio project. Now, open the project and bring up the AndroidManifest.xml file. There should be a meta-data element whose name is skillz_allow_exit. Change its value from true to false. If the element does not exist, then add it as below:

Screen_Shot_2019-05-13_at_2.59.06_PM.png

Build and run the game as usual. The option to exit the Skillz UI should no longer be available from the sidebar menu.

Unity Editor

The process of modifying the manifest file is roughly the same from the Unity editor. However, the file is called DefaultAndroidManifest.xml and is located under the Skillz -> Resources folder of the Skillz Unity cross-platform SDK wrapper in the Unity project:

Screen_Shot_2019-05-13_at_3.32.54_PM.png

Save the change to file. Now, export an Android Studio project as usual to complete integration with the Skillz SDK for Android. The values in DefaultAndroidManifest.xml will get merged into the final output for AndroidManifest.xml.