-
(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
0 个回复