LoginSignup
20
21

More than 5 years have passed since last update.

Objective-CでWiFiのSSIDを取得する

Last updated at Posted at 2013-02-15

※下記のフレームワークが必要
SystemConfiguration.framework

    // 3G接続の場合はnilが戻されるので、以降のコードで注意する。
    CFArrayRef interfaces
        = CNCopySupportedInterfaces();

    CFDictionaryRef dicRef
        = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0));

    if (dicRef) {
        ssid = CFDictionaryGetValue(dicRef, kCNNetworkInfoKeySSID);
        // Macアドレスを取得
        //macAddress = CFDictionaryGetValue(dicRef, kCNNetworkInfoKeyBSSID);

        NSLog(@"%@", ssid);
    }

20
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
21