views:

407

answers:

1

Is there any property or other mechanism in iPhone OS to check during runtime whether application is running on iPad 3G or iPad Wi-Fi? Seems like UIDevice class does not provide anything like that.

My application is using internet access extensively and I would like to explicitly warn user that on 3G delays or additional costs can be expected OR even ban application from running on iPad 3G with some fancy popup.

+1  A: 

I assume that other than 3G networking capabilities, there is no need to make a difference. Using Reachability.h class provided by Apple you can check if internet connection is available and if it is Mobile network or Wireless network.

Sample code here: http://developer.apple.com/iphone/library/samplecode/Reachability/Introduction/Intro.html

The Reachability class provides the following values:

ReachableViaCarrierDataNetwork, ReachableViaWiFiNetwork or NotReachable.

texmex5
My application is using internet access extensively and I would like to explicitly warn user that on 3G delays or additional costs can be expected OR even ban application from running on iPad 3G with some fancy popup. Would Reachability class allow implementing this?
delirus
I thought that ReachableViaWWAN means "3G or Wi-Fi" and ReachableViaWifi measn "Wi-Fi only". Am I correct?
delirus
You can differentiate between CarrierDataNetwork and ReachableVieaWifiNetwork.
texmex5
texmex5's answer is good, but does not cover situation when both interfaces are down - for that situation it is impossible to detect HW capabilities. There is no way to simply detect iPad 3G from iPad Wi-Fi only, check here: https://devforums.apple.com/message/218350#218350
delirus
The Wifi+3G model also has real GPS hardware… so that makes 2 differences.
William Denniss