Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect LTE connection using iOS SDK?

I'm using the reachability API to detect my current connection, but I can only distinguish between WIFI and 3G.

I get the following flags:

LTE: kSCNetworkReachabilityFlagsIsLocalAddress|kSCNetworkReachabilityFlagsIsWWAN|kSCNetworkReachabilityFlagsTransientConnection|kSCNetworkReachabilityFlagsReachable

WIFI: kSCNetworkReachabilityFlagsIsDirect|kSCNetworkReachabilityFlagsReachable

The problem is that LTE returns the same flags as a 3G connection. Is there any way to determine whether the user currently has LTE or 3G?

like image 474
Gilad Novik Avatar asked Apr 15 '12 02:04

Gilad Novik


People also ask

How do I check my network on IOS?

Make sure that your device is connected to a Wi-Fi or cellular network. Tap Settings > General > About. If an update is available, you'll see an option to update your carrier settings. To see the version of carrier settings on your device, tap Settings > General > About and look next to Carrier.

How do I know if my Internet connection is swift?

In the viewWillAppear method, add an observer to the Notification Center, so every time the network state changes, like from Wifi goes to Cellular, this will be detected instantly and call the reachabilityChanged method. And in the viewDidDisappear method, remove the stop the notifier and remove the observer.


2 Answers

As of iOS 7, you can find this out using the currentRadioAccessTechnology property of CTTelephonyNetworkInfo in the CoreTelephony framework.

#import <CoreTelephony/CTTelephonyNetworkInfo.h>

CTTelephonyNetworkInfo *networkInfo = [CTTelephonyNetworkInfo new];

if ([networkInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
    // ...
}
like image 123
jzzocc Avatar answered Oct 14 '22 10:10

jzzocc


I wonder if this hidden Core Telephony API can provide you with enough info for you to determine whether you're attached to an LTE or a slower technology.

CTRegistrationGetCurrentMaxAllowedDataRate();

It might be worth experimenting with.

More about using private APIs here: iPhone mobile number using Core telephony

However, I've read that your app will be rejected by apple if you use private APIs.

like image 3
Ramin Ahangarzadeh Avatar answered Oct 14 '22 10:10

Ramin Ahangarzadeh