Reputation: 79
I want to exit the app at the time of no internet connection at launch time.I have used exit(0) to exit the app giving alert of NO Internet Connection to user.I heard it is not standard way to perform as app store rejects the app saying it as a bug and count it in crash.
Upvotes: 2
Views: 4133
Reputation: 765
For your reference:
https://developer.apple.com/library/prerelease/content/qa/qa1561/_index.html
So, you do not call the exit function if you want to get through Apple's app review.
Upvotes: 0
Reputation:
As @BJHStudios said, it is against Apple guidelines to force an app to close programmatically. As a user, it would also be an unwelcome feature.
As an example, if I opened your app and didn't have an internet connection, I might simply need to turn on wifi or disable airplane mode. It would be better in my opinion to be told there is no connection and be presented with a retry option so I could perhaps fix my connection without getting bumped back to the home screen.
Something like an infinite retry option is what many game makers use for online only games, and it doesn't cause any problems on submission.
Just food for thought.
Upvotes: 7