Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to quit iOS app after we do some checks

We don't want the user enter our app if the app is out-dated.

Is that is possible to quit a iOS app when we do some date check BEFORE the app launch?

Or it is possible to quit the application after the main view is loaded?

like image 992
camelcc Avatar asked Dec 19 '25 10:12

camelcc


1 Answers

Before the app launches: no. The launch animation is already in progress when the OS calls main.

After some time (1-2 sec): yes. You can use one of

[[UIApplication sharedApplication] terminateWithSuccess];
exit(0);
abort();
assert(0);
pthread_kill(pthread_self());

so many ways, but neither will go through AppStpre - you're not supposed to close your app programmatically. You're supposed to notify the user via an UIAlertView about the outdated app and disable interaction with the app.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!