Determine 3G Capabilities on iOS Device
-
30-06-2021 - |
سؤال
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.
المحلول
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]
لا تنتمي إلى StackOverflow