开发者

How to detect user changed wireless connection on iPhone?

开发者 https://www.devze.com 2023-01-14 09:01 出处:网络
I want to check the use开发者_JAVA百科r whether using whether wifi/3G connect or not, how can I check this behavior? thank you. Use Apple\'s \"Reachability\" sample app. It\'s become the code most use

I want to check the use开发者_JAVA百科r whether using whether wifi/3G connect or not, how can I check this behavior? thank you.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消