** UPDATE 11/12/09 : BOTH my wifi & network connection detection apps are WORKING Again! **
If you write an app that depends on internet access in order to function properly Apple requires that you detect the state of the connection and report it to the user when that connection is unavailable. If you do not Apple will reject your app on the basis that it is confusing to the user. Confusing because the app does not work and Apple assumes that the user will not understand why. Makes sense.
Here is one way to determine whether or not the users device has airplane mode enabled . . .
- Add SBUsesNetwork to the Info.plist
- Change its type to Boolean
- Add a check mark to enable
Here is handy little project that detects whether or not your application has access to a WiFi network:
Here is another handy little project that detects whether or not your application has any network access:
Download NetConnectDetection_3.0.zip
Feel free to use any of the above code in any way you wish. I am providing it in the hopes that it will help save someone from the headache that I experienced all day yesterday trying to get network detection to work
If you find any errors or corrections please notify me and I will update the sample apps. Thanks!



Hi
Thanx, this works perfectly and is far easier than anything else available.
Great! Glad I could help
Hi,
It seems that the NetConnectionDectection project is actually an empty project. I think you might have zipped the wrong file!.
@Rodcey, my bad! The correct file has been uploaded.
This does not seem to work for me on 3.0 – Haven’t tried it on any other device firmware though? Am I doing something wrong? :/
I ran the TestWifi.app on my 3G device with both wifi and airplane mode off and no alert popped up?
Thanks for the help, Apple rejected my app for the same reason!
[...] This blog isn’t updated as often as some of the others, but the articles that do come out are really useful. My favorite recent one is How to Detect Network Availability. [...]
Hi.
I have run all f the code but it doesn’t seem to work for an AT&T network.Please suggest.
I apologize, both of my network detection apps seem to be broken with OS 3.0+ I will post an update when I have corrected the errors.
Thanks for sharing~
[...] This blog isn’t updated as often as some of the others, but the articles that do come out are really useful. My favorite recent one is How to Detect Network Availability. [...]
It helps and saves the time for detecting the network connection.Thank for sharing.