-1

I know it's been asked before, but I need a way to terminate an application. We have a medical disclaimer at the top of our app. If the user rejects the disclaimer terms we can not go on. We could leave the disclaimer screen sitting there, but that is annoying.

I've read that Apple rejects apps that use exit() or any self termination technology.

Any idea of what the acceptable solution is?

Kara
  • 6,115
  • 16
  • 50
  • 57
Gramps
  • 9
  • 1
  • You could just load a screen that says you cannot continue without accepting the disclaimer, and pushing a button to relaunch the alert. – borrrden Feb 18 '13 at 06:17

3 Answers3

3

Basically, you can't.

What Apple says to do is to display a message stating that the app can not be used without accepting the disclaimer. They can then press the Home button to leave the app. If you were to exit, it will look like the app has crashed, which is what they are trying to avoid.

lnafziger
  • 25,760
  • 8
  • 60
  • 101
1

There is no Apple-accepted way of terminating app. But your app can quit when user presses home button. To achieve this you should set "Application does not run in background" to YES in your app's plist. As for disclaimer, it's probably better to show alert to user if he rejects and stay on that screen.

Timur Kuchkarov
  • 1,155
  • 7
  • 21
1

From apple doc...

Don’t Quit Programmatically


Never quit an iOS app programmatically because people tend to interpret this as a crash. However, if external circumstances prevent your app from functioning as intended, you need to tell your users about the situation and explain what they can do about it. Depending on how severe the app malfunction is, you have two choices.

Display an attractive screen that describes the problem and suggests a correction. A screen provides feedback that reassures users that there’s nothing wrong with your app. It puts users in control, letting them decide whether they want to take corrective action and continue using your app or press the Home button and open a different app

If only some of your app's features are unavailable, display either a screen or an alert when people use the feature. Display the alert only when people try to access the feature that isn’t functioning. `

How do I programmatically quit my iOS application?

Anil Varghese
  • 42,757
  • 9
  • 93
  • 110