I must show EULA on the first launch. I want to close the app if user doesn't accept it. What is the proper way to do it so that the app will be accepted to app store?
I read that using exit(0)
and [[UIApplication sharedApplication] terminate]
is not the way to go.
Asked
Active
Viewed 3,256 times
4

Quxflux
- 3,133
- 2
- 26
- 46

DixieFlatline
- 7,895
- 24
- 95
- 147
-
what do you mean by "not the way to go". Instead you just provide "Accept" button. – Satyam May 05 '11 at 07:46
-
2You can attach your EULA by iTunesConnect when submitting your app. Apple will display it automatically when user taps the "buy" button – akashivskyy May 05 '11 at 07:49
-
@Satyam: I tried to say that app will not be accepted to app store. – DixieFlatline May 05 '11 at 08:16
-
Hey Do you have some tutorial link for how to show EULA on launching...plz paste it below so I can refer – thanks in advance – Navnath Memane Jan 25 '12 at 08:35
2 Answers
9
Apple doesn't want you to exit the app because it looks like a crash. That is why they made -[UIApplication terminate]
private and will reject your app if you use it. They don't seem to reject apps that use exit
and I've seen apps exit themselves but I agree with Apple that it's not good UI behavior on iOS, it does indeed feel strange if you get thrown back to the home screen without having pressed the home button. So I recommend you simply show a screen with a message along the lines of "You cannot use the app without accepting the EULA. Either accept the EULA or press the Home button".

DarkDust
- 90,870
- 19
- 190
- 224
-
1Yep. Just offer an 'I Agree' button. They can either Agree or uninstall the app. Crashing the app is unnecessary. – Alan Zeino May 05 '11 at 07:51
-
Closing an application automatically is definitely against Apple's rules. Instead, put a full screen view on top of your application if the user does not agree. In this way, the application will be unuseable. – simonbs May 05 '11 at 08:08
0
You can suspend the app and it gives the appearance that the app is closing.
UIApplication *app = [UIApplication sharedApplication];
[app performSelector:@selector(suspend)];

Thomas Economous
- 141
- 1
- 2
- 8