Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the device name programmatically in iPhone sdk?

i get the device Mac and IP Address. But, don't get the device name.

any idea how to get more info if possible like "Network Utility" of device ?

like image 279
Dhaval Avatar asked Jun 23 '12 07:06

Dhaval


2 Answers

NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
like image 76
Mani Avatar answered Sep 29 '22 16:09

Mani


On iOS 4.1+, you can do this: If you are looking for SSID Name..

import

- (id)fetchSSIDInfo
{
    NSArray *ifs = (id)CNCopySupportedInterfaces();
    NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
    id info = nil;
    for (NSString *ifnam in ifs) {
        info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam);
        NSLog(@"%s: %@ => %@", __func__, ifnam, info);
        if (info && [info count]) {
            break;
        }
        [info release];
    }
    [ifs release];
    return [info autorelease];
}
like image 36
Deepak Avatar answered Sep 29 '22 14:09

Deepak