1***@qq.com
1***@qq.com
  • 发布:2017-05-05 14:55
  • 更新:2017-05-05 14:55
  • 阅读:1831

ios获取IMSI

分类:Native.js
  • (NSString *)getIMSI{

    CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];

    CTCarrier *carrier = [info subscriberCellularProvider];

    NSString mcc = [carrier mobileCountryCode];
    NSString
    mnc = [carrier mobileNetworkCode];

    NSString *imsi = [NSString stringWithFormat:@"%@%@", mcc, mnc];

    return imsi;
    }

谁能把这段oc 转成 native.js

            var CTTelephonyNetworkInfo = plus.ios.importClass("CTTelephonyNetworkInfo");  
                var info = new CTTelephonyNetworkInfo();  
                var CTCarrier = plus.ios.importClass("CTCarrier");  
                var CTCarrier  = plus.ios.newObject("CTCarrier");  
                var carrier = info.plusGetAttribute("subscriberCellularProvider");  

我到这一步 就报错 carrier 是 undefined

2017-05-05 14:55 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复