Is it possible to detect LTE connection using iOS SDK?

后端 未结 2 2062
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 17:57

    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.

    0 讨论(0)
  • 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 <CoreTelephony/CTTelephonyNetworkInfo.h>
    
    CTTelephonyNetworkInfo *networkInfo = [CTTelephonyNetworkInfo new];
    
    if ([networkInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
        // ...
    }
    
    0 讨论(0)
提交回复
热议问题