Idfa
[[[Asidentifiermanager Sharedmanager] advertisingidentifier] uuidstring];
Idfv
[[[Uidevice Currentdevice] Identifierforvendor] uuidstring];
Network type
-(NSString *) getnet
{
UIApplication *application = [UIApplication sharedapplication];
Nsarray *subviews = [[[Application Valueforkey:@ "StatusBar"] valueforkey:@ "Foregroundview"]subviews];
NSNumber *datanetworkitemview = nil;
For (ID subView in subviews) {
if ([SubView iskindofclass:[nsclassfromstring (@ "Uistatusbardatanetworkitemview") class]) {
Datanetworkitemview = SubView;
Break
}
}
switch ([[Datanetworkitemview valueforkey:@ "Datanetworktype"] integervalue]) {
Case 0:
NSLog (@ "No WiFi or cellular");
return @ "NULL";
Break
Case 1:
NSLog (@ "2G");
return @ "2G";
Break
Case 2:
NSLog (@ "3G");
return @ "3G";
Break
Default
NSLog (@ "Wifi");
return @ "Wifi";
Break
}
return @ "NULL";
}
Resolution
-(NSString *) GETFBL
{
Screen size
CGRect rect = [[UIScreen mainscreen] bounds];
Cgsize size = rect.size;
CGFloat width = size.width;
CGFloat height = size.height;
NSLog (@ "Print%f,%f", width, height);
Resolution
CGFloat scale_screen = [UIScreen mainscreen].scale;
return [NSString stringwithformat:@ "%d*%d", (int) (width * scale_screen), (int) (height * scale_screen)];
}
Get Carrier
-(NSString *) getop
{
NSString * ret = @ "";
Cttelephonynetworkinfo *info = [[Cttelephonynetworkinfo alloc] init];
Ctcarrier *carrier = [info subscribercellularprovider];
if (carrier = = nil)
{
[Info release];
return @ "NULL1";
}
NSString *code = [Carrier Mobilenetworkcode];
if (code = = nil)
{
[Info release];
return @ "Null2";
}
if ([code isequaltostring:@ "00"] | | [Code isequaltostring:@ "02"] | | [Code isequaltostring:@ "07"])
{
ret = @ "China Mobile";
}
if ([Code isequaltostring:@ "01"] | | [Code isequaltostring:@ "06"])
{
ret = @ "China Unicom";
}
if ([Code isequaltostring:@ "03"] | | [Code isequaltostring:@ "05"])
{
ret = @ "China Telecom";
}
if ([Code isequaltostring:@ "20"])
{
ret = @ "China Tietong";
}
[Info release];
return ret;
}
This article is from the "accompany you through the Long Years" blog, please be sure to keep this source http://4774721.blog.51cto.com/4764721/1792324
iOS get phone status IDFA IDFV network type resolution get carrier