Can you pass WiFi settings from an iOS device to an ExternalAccessory object?
Asked Answered
C

5

33

I've heard that iOS 5 introduced a feature in which the iOS device can share its wifi configuration with a docked accessory via the ExternalAccessory framework. The trouble is that I can't find any specific details on implementing this type of scheme in the SDK docs.

From my research, I've begun to suspect it's achieved via the 'iPhone Configuration Utility' but this still seems like a bit of a messy method to implement on a device.

Anyone got any ideas?

Once the wifi setup data is available, it should be easy enough to package it up and send it out via the ExternalAccessory framework to the device, where I'll build in protocol support accordingly.

Thanks

Certitude answered 11/1, 2012 at 15:23 Comment(10)
I'm now leaning towards the CNCopyCurrentNetworkInfo function in the CaptiveNetwork interface.Certitude
CaptiveNetwork referenceCertitude
hmm yeah. i had a dig around the docs, seems like CNCopy.. just spits out a hashed version of the ssid/key etc. so kindof pointless in my application.Certitude
i've found a hardware dependent way of doing this, but it too seems like magic. think it's specific to Apple/hardware vendor, not a publicly accessible method.Certitude
@Certitude What is the hardware dependent method you mentioned?Mancuso
Using a dedicated airplay streamer module, not quite sure how the magic works. any more info would be NDA infringing... sorryCertitude
True, this part is under MFi NDAClyte
The only way you'll find reliable information on it is applying to the MFi program. It's not easy to get into this program.Futhark
i'm already an MFi developer with 2 iPod dock systems on the market.. couldn't find anything easily on there, but it's been sorted now. thanks for your recommendations!Certitude
#5868150 check this linkCrossexamine
U
1

I doubt Apple would ever allow for an average developer to access private data such as wifi connections settings. Maybe trusted third party accessory provider yes, but you probably no.

Wifi settings are private and contain passwords. An average (non-power) user uses more or less the same/similar password for everything including their Wifi network. If an app can easily read that it could be badly exploited.

The same way you cannot get the Apple id let alone the password.

Unimpeachable answered 16/3, 2012 at 0:29 Comment(3)
It does exist in iOS 5. I've never wanted to actually read the data, just pass it over to the host MCU. This is now working in my product.Certitude
I just started looking into the same thing for a product, I am running into the same issues you had it seems. Are you able to provide any pointers?Tbilisi
Not without breaking 2 NDAs I'm afraid. If you're MFi licensed then you should be able to find this out.Certitude
M
13

Yes! you certainly can. However, to use HomeKit (the library you need) you first need to be a certified MFi (Made For iDevice-iPhone-iPod-iPad) developer. This gives you the ability to allow a user to view all available wifi networks and choose to link the device.

One example of this is Withings with their Aura sleep aid. See screenshot from on boarding experience:

enter image description here

Then the user can then choose to share their home wifi information securely with the new device.

enter image description here

Montagnard answered 16/10, 2014 at 21:31 Comment(1)
The bad news is that getting approved is a bit of a process. It'll take a lot of effort for a small company but is for sure worth it to the end user. Gives a more professional, seamless setup process - pretty much same one you'll use when you set up your Gen 4 AppleTV!Montagnard
R
2

The user-visible UI looks like this:

enter image description here http://www.theregister.co.uk/2012/07/12/pure_contour_200i_air_airplay_wireless_music_system/

enter image description here https://withings.zendesk.com/hc/en-us/articles/201488707-Wi-Fi-Setup-of-the-Wireless-Scale-WS-30

Rough answered 7/5, 2014 at 18:10 Comment(1)
Hi, I Have registered for the MFI program and now I am trying to read the wifi networks. But since I have not used the home kit earlier, I have not getting how to read the wifi networks. Is there any tutorial or samples available to achieve the same. Please share itPhenix
D
2

A bit late but configureAccessory is the method (part of ExternalAccessory) introduced in iOS 8.0 that you can use to configure a wifi accessory:

https://developer.apple.com/documentation/externalaccessory/eawifiunconfiguredaccessorybrowser/1613907-configureaccessory

It's part of the EAWiFiUnconfiguredAccessoryBrowser class:

https://developer.apple.com/documentation/externalaccessory/eawifiunconfiguredaccessorybrowser

And showBluetoothAccessoryPicker is the one for Bluetooth products:

https://developer.apple.com/documentation/externalaccessory/eaaccessorymanager/1613913-showbluetoothaccessorypicker

which is part of the EAAccessoryManager class:

https://developer.apple.com/documentation/externalaccessory/eaaccessorymanager

Ducharme answered 19/7, 2018 at 15:55 Comment(0)
U
1

I doubt Apple would ever allow for an average developer to access private data such as wifi connections settings. Maybe trusted third party accessory provider yes, but you probably no.

Wifi settings are private and contain passwords. An average (non-power) user uses more or less the same/similar password for everything including their Wifi network. If an app can easily read that it could be badly exploited.

The same way you cannot get the Apple id let alone the password.

Unimpeachable answered 16/3, 2012 at 0:29 Comment(3)
It does exist in iOS 5. I've never wanted to actually read the data, just pass it over to the host MCU. This is now working in my product.Certitude
I just started looking into the same thing for a product, I am running into the same issues you had it seems. Are you able to provide any pointers?Tbilisi
Not without breaking 2 NDAs I'm afraid. If you're MFi licensed then you should be able to find this out.Certitude
A
1

Have you seen this: iPhone get SSID without private library

Is prompting the App user for a secured network password out of the question?

You can at least get the SSID of an unsecured network and pass it to your accessory with a getter something like:

#import <SystemConfiguration/CaptiveNetwork.h>


@implementation DeviceWifiSSID

//https://mcmap.net/q/151089/-iphone-get-ssid-without-private-library
+(NSString *)deviceSSID
{
    NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();


    id info = nil;
    for (NSString *ifnam in ifs) {
        info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);

        if ([info objectForKey:@"SSID"] != nil)
        {
            return [info objectForKey:@"SSID"];
        }
    }


    return nil;
}

@end
Apices answered 22/3, 2012 at 1:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.