iOS WiFi network switching

我是研究僧i 提交于 2019-12-21 14:24:43

问题


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!


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6989535/ios-wifi-network-switching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!