Reputation: 30598
I want to check the user whether using whether wifi/3G connect or not, how can I check this behavior? thank you.
Upvotes: 0
Views: 416
Reputation: 21903
Use Apple's "Reachability" sample app. It's become the code most used for determining network connectivity.
http://developer.apple.com/iphone/library/samplecode/Reachability/Introduction/Intro.html
You can check once at launch time for network access, or set yourself up as a notification consumer of network connection change messages.
This is important these days because Apple will test your app in Airplane Mode, and if it requires network connections it can't get, but doesn't handle that nicely, they'll bounce your submission.
Upvotes: 1