Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-18-2010, 01:14 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 6
Default Close an app with code. Acceptable practice?

Hello,

I am implementing a message that informs the user that the app is out of date and if the user chooses to not update, the app will close when he clicks No.

A friend mentioned that the only way an app should close is by clicking on the Home button of the device and that Apple may reject your application if you try to do it from a button in your app.

Ideas? Thoughts? Experiences?

Thanks!
mbc230 is offline   Reply With Quote
Old 03-18-2010, 01:26 PM   #2 (permalink)
Game Developer
 
Join Date: Jul 2009
Location: Austria
Posts: 65
Default

There is a way to exit an app programmaticly, but the Apple HIG is against that:
Code:
exit(1);
nitrorazor is offline   Reply With Quote
Old 03-18-2010, 01:29 PM   #3 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 6
Default

So if the HIG is against it, does that mean that it would be rejected? Have you launched an app in the Store and it passed with exit(1) in it?
mbc230 is offline   Reply With Quote
Old 03-18-2010, 01:39 PM   #4 (permalink)
Game Developer
 
Join Date: Jul 2009
Location: Austria
Posts: 65
Default

Hm, I think there's a risk that your application gets rejected. Maybe it's better when you write a warning message to the user that the app will quit now.
nitrorazor is offline   Reply With Quote
Old 03-18-2010, 01:48 PM   #5 (permalink)
iOS / MacOS Developer
 
bharath2020's Avatar
 
Join Date: Oct 2008
Location: Bengaluru
Posts: 150
Default

One trick is to use openURL method of UIApplication and try opening some dummy URL which quits the application and launches safari..
__________________
Bharath
iOS Blog : http://iphone2020.wordpress.com
bharath2020 is offline   Reply With Quote
Old 03-18-2010, 02:32 PM   #6 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 791
Default

You could instead show a blank view stating that the app cannot continue its execution unless the user updates clicking a button... You don't need to quit, you just leave the option to the user, either click to update or hit the Home button to quit.
nobre84 is offline   Reply With Quote
Old 03-18-2010, 04:11 PM   #7 (permalink)
Registered Member
 
ChrisMayer's Avatar
 
Join Date: Aug 2009
Posts: 238
Default

Personally I'd say the best way to deal with this situation would be to inform the user that the app is out of date and need to be updated, then provide them with a button that will take them to the app store.
That way if the user doesn't want to update they can simply tap the home button to quit the app.
I would imagine Apple should approve of this.
__________________
ChrisMayer is offline   Reply With Quote
Old 03-18-2010, 04:27 PM   #8 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 41
Posts: 1,184
Default

Is there a reason why a user shouldn't be allowed to run an older version of the app?
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 03-18-2010, 05:18 PM   #9 (permalink)
Will Work for Food!
 
itzdark's Avatar
 
Join Date: Apr 2009
Posts: 579
Send a message via AIM to itzdark Send a message via MSN to itzdark
Default

Quote:
Originally Posted by nobre84 View Post
You could instead show a blank view stating that the app cannot continue its execution unless the user updates clicking a button... You don't need to quit, you just leave the option to the user, either click to update or hit the Home button to quit.
Quote:
Originally Posted by ChrisMayer View Post
Personally I'd say the best way to deal with this situation would be to inform the user that the app is out of date and need to be updated, then provide them with a button that will take them to the app store.
That way if the user doesn't want to update they can simply tap the home button to quit the app.
I would imagine Apple should approve of this.
I think these two came up with the best idea for your situation.

Apps can be allowed that call exit(0); but I would imagine apple can be particular about the reasons for letting you call it.
__________________

Check out my apps

Developers, check out study buddy. I use it everytime I code. It's great for those late night coding sessions.
Unofficial Ad Hoc Distribution Guide || Join my cooperative ad hoc testing group
iSoothe Promotional Video
Contact Me
itzdark is offline   Reply With Quote
Old 03-18-2010, 06:18 PM   #10 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
Default

Quote:
Originally Posted by itzdark View Post
I think these two came up with the best idea for your situation.

Apps can be allowed that call exit(0); but I would imagine apple can be particular about the reasons for letting you call it.
Well, I personally wouldn't be happy if my application wouldn't work just because there is a new version around.

I think that the user paid that application and therefore you should leave him using it.

Imagine if the user is somewhere where there is no data connection (or is abroad and do not want to activate roaming data) and cannot use the application he has paid for.

Just my 2c
elite is offline   Reply With Quote
Old 03-18-2010, 06:34 PM   #11 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 41
Posts: 1,184
Default

Quote:
Originally Posted by elite View Post
Well, I personally wouldn't be happy if my application wouldn't work just because there is a new version around.

I think that the user paid that application and therefore you should leave him using it.

Imagine if the user is somewhere where there is no data connection (or is abroad and do not want to activate roaming data) and cannot use the application he has paid for.

Just my 2c
That was my thought as well... last time I was abroad, I signed up for a one month international data package; something like 50MB for a month for about $60. It would suck having to use a significant chunk of that just to download a forced app update! And even more so if no special international data plan had been purchased (in which case I think AT&T charges more like $10/MB... or maybe it was $20/MB?).
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone close reject

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 352
20 members and 332 guests
ADY, Dani77, Duncan C, e2applets, Grinarn, HemiMG, Herbie, JasonR, keeshux, linkmx, macquitzon216, mer10, Monstertaco, prchn4christ, Promo Dispenser, Robiwan, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,881
Threads: 89,228
Posts: 380,760
Top Poster: BrianSlick (7,129)
Welcome to our newest member, macquitzon216
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0