I am looking to design a way to configure wifi setup for a non-apple device, by pairing it via bluetooth with an app on an iPhone.
The iPhone would be one already connected to the target wifi network. The app would support its own bluetooth connection with the non-apple device
I understand that there are entitlements, like CNCopyCurrentNetworkInfo
, but from research it doesn't look like that is enough. Maybe there are others? Or is this only possible by being approved to implement HomeKit on the 'target non-apple device'?
The presume path of data is
- credential stored in iOS
- some entitlement that permits access to unencrypted data
- app with entitlement
- app security handles data
- valid bluetooth pairing of the app
- unencrypted password sent via bluetooth
- non-apple device uses the network SSID + credential to make its own connection
Thanks for your help or corrections. These existing Q&A do not answer it: 1, 2
CNCopyCurrentNetworkInfo
does not give you the password, even if you jump through all the hoops including users location permission. Theoretically you can only get SSID of the connected network (with location permission from the user)Best humane way to approach this (as of today) is by asking the user to enter their WiFi SSID/password in a popup and send it to the Bluetooth device. I was not able to find a better way.
If you use something like Blufi, you can :
PS. it would be quite spooky if there was a way to read system keychain passwords from an app.