[Solved] - Is there a healthy alternative to "Application.Quit()?"

Issue:
The video mentioned not using Application.Quit() when attempting to quit an application due to it not being transferable from platform to platform and went as far as mentioning your application may get rejected from an app store for containing it.

Platforms with suspected issues:

  • Android
  • iphone
  • Webplayer/WebGL

Expected Result:
A solution that allows users to quit an application, when allowed, that will not cause errors on certain platforms, or break common standards of application distributors(app stores).

Attempted Solutions:

  1. Googled for a uniformed method to no resolve.
  2. Looked for standards on whether or not it is even appropriate to close an application anymore and found little in the way of standards.
  3. Played around with monodevelop to see if it had a solution.

Possible Solutions(hopefully avoidable):

  1. Just have different versions of the application with some containing application.quit().
  2. Change quit to go back to the main menu and allow the user to close the application with the os features.

I don’t know about the others, but Apple offer their opinion on this here (as investigating the unity script API for Application.Quit revealed to me).

I got the impression from the lectures that, essentially, the standard is not to provide any ‘quit’ functions for mobile/web applications, but you’d need to do some research with the various platform’s guidelines to determine whether there are stated exceptions to that.

I suppose if you wanted to make quitting the game feel a bit more traditional on those platforms, you could have your ‘quit’ method, rather than trying to close the app for the user, instead take them to a ‘thanks for playing!’ / ‘please review/rate before you go!’ type screen - but that seems to fall under your ‘hopefully avoidable’ list.

Alternatively, if you’re just thinking in terms of being able to easily port between platforms and minimising the amount of work needed to do so - keep it in mind when you’re structuring your code and then just disable ‘quit/exit’ buttons and functions as appropriate for your build. Although perhaps this is what you meant by wanting to avoid different versions? I’m not sure, since you can’t use the same build for the different platforms, so you’re going to end up with different output versions anyway.

Getting a little ahead of things, you’re probably going to end up with a couple of different versions for porting anyway, since you’ll have to consider differences such as screen resolution and input methods.

2 Likes

That’s a brilliant idea! I will keep that in mind for the future.

Thats a good idea. Currently, for the number wizard ui, I put a quit button on all the guess screens and just allowed it to return to the start menu. It would look a lot cleaner though doing as you mentioned. and give them an option to return to the game, vote, or…do nothing.

Thanks!

Privacy & Terms