0

I've been searching the internet for a while now, but I can't seem to find anyway of determining if the device an app is running on supports 3G data.

I don't want to be able to see if it is currently active which is what the Reachability class does, I would like to know if the device has 3G hardware.

Thanks in advance.

JazzyHack
  • 11
  • 1
  • What are you trying to achieve? What's the use case for wanting to know about 3G but not actually use it? – Stephen Darlington Sep 05 '12 at 12:01
  • Having certain 3G specific functions only available to devices with 3G present to them. It will save a lot of space in my app for those who don't need those functions – JazzyHack Sep 05 '12 at 12:05

1 Answers1

0

Have you considered detecting the type of the device ?

If it's an iPhone 3G/3GS/4/4S or an iPad with 3G, it has 3G. Otherwise no.

Maybe this library can help you : UIDevice Extension

I'm not sure if it can tell you wether the iPad is 3G or not, but for iPhones/iPodTouchs it may work well...

EDIT :

You can use this code to get the device type :

[UIDevice currentDevice] platformType]

Or this to directly get a NSString :

[[UIDevice currentDevice] platformString]
rdurand
  • 7,342
  • 3
  • 39
  • 72
  • I have considered the possibility of doing this, but it will require maintenance as newer models of devices are released. Also, I can't see anything in the extension provided that could do what i want it to. – JazzyHack Sep 05 '12 at 11:58
  • No, this extension does not do exactly what you want. You won't get the exact information you want. So yes, it may require some maintenance once or twice a year :) I'll keep looking for an answer, I just suggested that in case no better solution is given. – rdurand Sep 05 '12 at 12:01
  • Do you want the 1st gen iPhone to "return" yes ? I mean, are you strictly searching for devices with 3G, or do you want to check cellular network capability in general ? – rdurand Sep 05 '12 at 12:09
  • If it has cellular capability, then return yes. So yes, I would like for the 1st gen to return yes. – JazzyHack Sep 05 '12 at 12:25
  • Ok, maybe then you could change the name/description of the question ? It may attract new users who may have an possible answer... Not really sure about that but it will probably be more accurate... Anyways, I saw on my searches that it was not available in iOS 4. So maybe something exists for iOS 5, but you would always have a compatibility issue... I don't think there's a better option than detecting the device. Maybe if you don't look for devices *with* cellular but for devices *without*, you can limit the maintenance ? – rdurand Sep 05 '12 at 13:52
  • Thanks. Apple really should support this in the UIDevice class. But checking the device model is a decent hack (minus the overhead of maintenance). – JazzyHack Sep 05 '12 at 14:13
  • What's even crazier is that Apple explicitly tells us to avoid detecting the device type (saw this while I was searching, I don't remember where, but on an official developer page), but they don't provide tools for cellular capability.. Hope you'll work your way with this one. – rdurand Sep 06 '12 at 07:51