Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
WIFI SSID
-
Hi there!
Can anyone show me how to access the current WIFI SSID via Pythonista? This would be awesome in the widget.
Thanks,
John -
-
It must be possible because the Launcher app allows to display it in its widget.
-
I think this requires a special app entitlement
-
I think you're right, as I´ve read
-
"Your program needs the com.apple.wifi.manager-access entitlement to use any of the WiFiManager functions."
-
This works for me:
from objc_util import * def get_ssid(): CNCopyCurrentNetworkInfo = c.CNCopyCurrentNetworkInfo CNCopyCurrentNetworkInfo.restype = c_void_p CNCopyCurrentNetworkInfo.argtypes = [c_void_p] info = ObjCInstance(CNCopyCurrentNetworkInfo(ns('en0'))) return str(info['SSID']) print('Current SSID:', get_ssid())
-
I was almost sure it was possible since Apple did stop to depreciate this CNCopyCurrentNetworkInfo in ios10...
Thanks for @inyourfaceplate
-
@omz Ah a c function I'm going to have to remember that for my objc_tools network submodule
-
omz's solution works great!
Thanks everyone!
-
Hi @omz,
I found that your solution is not work anymore (ios 13.3.1). Its return "wifi" instead of correct name. Do you have ideas? -
@vladimir_key omz solution works for me but you need iOS 13.3 and that you Pythonista app has permission to access your location (iOS 13 limitation)
See Discussion
Seems that if you receive "wi-fi", you should be in iOS 12
-
Hi @cvp,
Thank you! Yep, it was location permission problem. Now its working and my iOS 13.3.1. -
For some unknown (for me) reason, I got this error message:
"No method found for selector "isKindOfClass:"Any clue?
-
Same for me
-
Looks to be some kind of internal bug in
objc_util
, though I don’t have an explanation right now. -
@omz seems that CNCopyCurrentNetworkInfo(ns('en0')) returns nil like old bug before ios13.3
-
For me it no longer works since Pythonista 3.3
-
Could have something to do with the fact that 3.3 is built with the iOS 13 SDK.