Get SSID when WIFI is connected

I listen for WifiManager.NETWORK_STATE_CHANGED_ACTION in a broadcast receiver if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) { NetworkInfo netInfo = intent.getParcelableExtra (WifiManager.EXTRA_NETWORK_INFO); if (ConnectivityManager.TYPE_WIFI == netInfo.getType ()) { … } } I check for netInfo.isConnected(). Then I am able to use WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifiManager.getConnectionInfo(); String ssid = info.getSSID(); UPDATE From android 8.0 onwards we wont … Read more

iPhone get SSID without private library

As of iOS 7 or 8, you can do this (need Entitlement for iOS 12+ as shown below): @import SystemConfiguration.CaptiveNetwork; /** Returns first non-empty SSID network info dictionary. * @see CNCopyCurrentNetworkInfo */ – (NSDictionary *)fetchSSIDInfo { NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces()); NSLog(@”%s: Supported interfaces: %@”, __func__, interfaceNames); NSDictionary *SSIDInfo; for (NSString *interfaceName in interfaceNames) { SSIDInfo … Read more

tech