Is it possible to detect LTE connection using iOS SDK?

后端 未结 2 2061
Happy的楠姐
Happy的楠姐 2021-02-04 17:15

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: kSCNetwork

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-04 18:05

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

    #import 
    
    CTTelephonyNetworkInfo *networkInfo = [CTTelephonyNetworkInfo new];
    
    if ([networkInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
        // ...
    }
    

提交回复
热议问题