iOS WiFi network switching - ios

My company is developing an iPhone accessory that requires a relatively high connectivity rate to the phone. Due to MFi limitations (USB 2 communications in HOST mode fair only around 100KBps), we're looking at hosting a WiFi ad-hoc network on our accessory, and connecting to that network with the iPhone's WiFi.
This could really work out great in many regards, except we can't seem to find an (Apple-approved) way to programmatically switch the iPhone's WiFi connectivity. Ideally the app would automatically connect to the accessory's network when visible, and then re-connect to the user's preferred network when not visible/needed.
We are aware of the MobileWiFi framework, which fits the technical bill, but won't pass Apple's approval process.
Can anybody suggest a way to achieve our goal? Perhaps there is a system model view that can be called up to allow the user to switch WiFi networks without directly using private APIs?
Creative solutions welcome!

Hate to say it, there's really no way to do it. I can think of two easy workarounds.
1. Make it available on Cydia for jailbroken devices. AirServer just did this.
2. Less elegant, have UIAlertView with a switch over to the wifi pane of the Settings app that is shown when the peripheral is connected and disconnected. A lot like the location settings prompt.
3. Make an Android app!
Apple, you're a pain in the ass.

Sorry to be the bearer of bad news, but the definite answer is no. The main problem with your approach wouldn't even be Apple's approval process, but the inability to access the Internet while connected to your device. iPhone doesn't even try using cellular data when connected to wifi, being that wifi connected to the Internet or not.
You could file a bug report requesting these features and pray Apple hears you which will probably never happen in this case.
I would suggest going bluetooth, but if usb is not fast enough for you, guess that's not an option either.
That pretty much puts you back to square one and going usb. Or distributing your app via Cydia.

Related

How to connect iOS app to a hardware over wifi? Is it possible

I have this situation and I hope that anybody will be able to help me with.
So we have some hardware devices that needs to be controlled by an iOS app (either all together or one at a time which ever possible to be implemented) and in return the hardware returns values to the app! Possible scenarios:
The iPad acts like a hotspot and the devices connects to it then the app control the hardware and read data from it. In this way no need for a router.
The hardwares connects to a local network where the iPad also connected then the app controls the hardware and can read data from (I think this can be done as if was a printer and an app communicate with the printer over wifi).
Now, I have no information how to do that or if this is even possible. I searched online but couldn’t find that much of info about it.
I appreciate all the help on this.
Thanks

Bluetooth Communication Possibilities

I have a simple question.
I know that when you pair bluetooth headphones to a phone it automatically takes over the sound and it starts playing on your headphones.
Is it possible to program a device so that, as soon as it pairs with a phone, it turns on the phone's flashlight for example?
I know that you can probably program anything to do anything, but I'm curious to know if there are any limitations? Does Apple restrict developers and engineers from creating devices that tamper with their iPhone (like the flashlight thing)? Or is it pretty much an open market?
Yes, this is very restricted to protect users.
Bluetooth works by communicating over defined profiles. Pairing does not have a side effect (like turning on the flashlight), it just bonds the two devices. To control each other, the devices have to use profiles. For example, when you connect your headphones to a phone, they probably connect both AVRCP (Audio/Video Remote Control Profile) and A2DP (Advanced Audio Distribution Profile). These profiles have very fixed scope so that developers and engineers cannot tamper with users devices in unexpected ways.
Apple is especially careful with their devices. For any Bluetooth classic device that wants to implement a profile outside of the default ones, a MFi chip is required. Bluetooth LE devices are much more open, and users can connect them to their phone either through an app or the OS itself. Apps are able to turn on the flashlight, like you describe, but it requires camera permissions and is not allowed to run in the background.
Assuming you could be talking about software as well (the question is vague enough that it doesn't point to hardware only)...
I worked extensively with CoreBluetooth, the framework allows you to create both sides of the connection (transmitter, receiver or client, server; depending on how you want to look at it). Should you wish to create an app on the phone as one of them, and another app an a phone or a mac (or iBeacons) as the other, you'd be able to create that connection and control stuff on the "client" from the "server" and vice versa. You could control as much as the Apple API allows you to control.

How to restrict WiFi change on iPad

I have this solution for my customer's retail stores - they have iPad Air 2, with iOS 8.1.3, router and workstation with large TV and it's absolutely necessary that the iPad will stay connected only to WiFi I am providing with those routers. If anyone changes to another hotspot, the solution won't work. So I am looking for some ways that will prevent that, either in settings or via some app..
Also, it might work with apple configurator, but I couldn't find any site where it is mentioned.
Thx for advices
Unfortunately there is no means to restrict iOS devices to a single WiFi, even with an MDM and device supervision. I have a close relationship with Apple and this has been ask from education and retail partners for over 4 years now. I feel your pain.
A "workaround" for this would be possible if you happen to be using a single app that you have developed to access these resources. If that is the case you can either interrogate which SSID the device is attached to and throw a warning if it is not correct. There are also a myriad of other examples like this to detect the wrong SSID or spoofed SSID but no way to currently lock the device to the correct SSID.

iPad as WiFi router

I've been tasked with getting an iPad to talk to an external device wirelessly on the cheap. I tried the Bluetooth route (not LE - need higher data transfer rate), but we're not willing to go through MFi.
So now I'm looking at WiFi. It may be possible to configure my external device to act as a WiFi router, but it may be easier to get the iPad to act as the router. That's what I'm trying to figure out here.
So I've thought of two possibilities, neither of which I could find any answers for on Google or within SO. Does anyone know the answer to any of these?
Is it possible to have the iPad act as a WiFi router such that other devices connect to the iPad and can communicate with an app on the iPad?
When built-in tethering is active on the iPad, does the iPad have an IP address that is visible to any device connected to the iPad's WiFi hotspot?
When built-in tethering is active of the iPad, is there a way for the iPad to get notified of connections made to the hotspot and get the IP addresses of those devices?
A little more specifically, I need a way for a device to wirelessly communicate with an app on the iPad. I've already gone through the Bluetooth route and I'm hoping for a WiFi answer.
Thank you.
In the interest of not leaving a question open, I'll answer with what I've found:
No
As far as I've been able to tell in my research and experimentation, there is no way to do what I was hoping for. Thank you to Brad Larson for doing his best to give me options.

Is it verified that iPad cannot create ad hoc wifi networks?

Has anyone been able to verify that the iPad cannot create an ad hoc network?
It has different radio hardware (the fact that it does 802.11n demonstrates this) than the iPhones, which I thought was the reason that the iPhones could not create WiFi networks.
I know this was sort of answered elsewhere, but I wanted it to get proper attention with its own question and by more tag coverage.
Jeff, your god of biscuits. ;)
Just looked, and I can't see an option to create an ad hoc network anywhere on my iPad. If it's possible in the hardware, it's certainly not allowed by the software. IMO, I doubt that an app with that sort of functionality would make it through the app store process.
Wanted to update this question: as of iOS 7, the Multipeer Connectivity Framework provides a very high level means of establishing ad-hoc networks via WiFi and/or Bluetooth. It even bridges from WiFi from/to Bluetooth if some ad-hoc network clients have WiFi off and some have Bluetooth off.

Resources