Objective-C determine data network type of the iOS device

后端 未结 3 527
一生所求
一生所求 2020-12-23 10:24

Im on an application that receive data from server, the problem is when user connect to cellular data (Not 3G or WIFI), it take ages t

3条回答
  •  长情又很酷
    2020-12-23 11:21

    if using iOS 7+ then you can get information from CoreTelephony framework following method :

    CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
    NSLog(@"Current Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology);
    

    Possibles values defined which you will get are as follows : CTRadioAccessTechnologyGPRS, CTRadioAccessTechnologyEdge ,CTRadioAccessTechnologyWCDMA , CTRadioAccessTechnologyLTE etc

提交回复
热议问题