Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine whether user is on Edge or 3G on iPhone

Tags:

iphone

Though it is relatively straightforward to determine if an iPhone is on Wifi or a data network programmatically in your application, I can't figure out a way to determine if the iPhone is on Edge or 3G.

Anybody figure out a way to determine this?

Note: Not worried about Apple AppStore acceptance policies so I don't mind doing something hacky in my app. (The iPhones should not have to be jailbroken though)

like image 884
MobileDev852 Avatar asked Sep 04 '09 19:09

MobileDev852


2 Answers

The iPhone doesn't provide this kind of information to developers programmatically. The best you can hope for is to determine whether a connection to a given host will have to be routed over a cell network - see the SCNetworkReachability reference and the Reachability project for more.

like image 176
Tim Avatar answered Nov 18 '22 10:11

Tim


Assuming the answer by Tim is right, one way you can tell if the user is on 3G or edge is you can test the speed of the connection by starting a timer having the app download some file from the web and calculate the speed, you should be able to tell if they are on 3G or Edge by the diffrence in speeds.

like image 24
Daniel Avatar answered Nov 18 '22 10:11

Daniel