Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 64

rhundle denz
Aspiring developer
Profile
Posts: 53
Reg: Feb 22, 2012
location unknow...
2,630
08/28/12 08:52 AM (11 years ago)

Check internet connection before opening the app

Hi guys, I am making an app which requires using internet connection most of the time. However, i want to prompt the users to turn on the network connection prior to opening the app or else the app will not load if the device is not connected to the internet. Is it possible? Thanks in advance.
 
MacApple
Apple Fan
Profile
Posts: 4674
Reg: Oct 25, 2010
USA
61,140
like
08/28/12 08:55 AM (11 years ago)
Quick fix would be to prompt user with a splash screen saying please turn on network connection for this app to function at its best.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/28/12 09:07 AM (11 years ago)
Also, when you list your app in whatever store you put it in, make sure to clearly state that the app requires a network connection to work. That way you are completely upfront with them about the requirement before they buy it. Mark
 
MacApple
Apple Fan
Profile
Posts: 4674
Reg: Oct 25, 2010
USA
61,140
like
08/28/12 09:08 AM (11 years ago)
Good shout Mark! Make them aware right from the off.
 
rhundle denz
Aspiring developer
Profile
Posts: 53
Reg: Feb 22, 2012
location unknow...
2,630
like
08/28/12 09:42 AM (11 years ago)
Alright. How about if use an alert view?
 
theMonster
Code is Art
Profile
Posts: 435
Reg: Oct 18, 2011
US
8,050
like
08/28/12 09:54 AM (11 years ago)
Presenting an alert and the beginning of the app is very simple. Go into your app delegate .m file, and paste in this code after the [window makeKeyAndVisible] line: [[[UIAlertView alloc] initWithTitle:@"Internet Required" message:@"Make sure you have your Internet turned on" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; Hope that helps!
 
rhundle denz
Aspiring developer
Profile
Posts: 53
Reg: Feb 22, 2012
location unknow...
2,630
like
08/28/12 10:08 AM (11 years ago)
Wow. it worked. One more request, can the cancel button be changed to "Setting" such that when the user cancels it will go to the network connection setting for them to enable it? Thanks very much in advance.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.