Working with MultipeerConnectivity in iOS swift

巧了我就是萌 提交于 2019-12-11 16:08:39

问题


I'm working with MultipeerConnectivity framework in iOS, followed a nice tutorial and it worked well.

I have one question, I have two devices with wifi turned OFF but Bluetooth is ON, for the above approach to work, is it necessary for the two devices to be paired(via bluetooth, manually by the user in iOS settings)?

Will it work even if the devices are not paired manually?

If yes, do I need any special code setup or the above code will just work?(I have tried, for me It didn't work. Might be the OS issues? source1, source2)

If no, Is it possible to do Bluetooth pairing automatically via a program?

Thanks!


回答1:


You do not need for the devices to be paired.

The code I used in my Multipeer Connectivity tutorial required no pairing. This code allowed one iOS device to act as a remote control for another iOS device's camera and send the photos back to the original device using Bluetooth or WiFi. The app works over Bluetooth without any pairing between the two devices.

Hope this helps!

UPDATE

MPC will not work over Bluetooth on iOS 11+



来源:https://stackoverflow.com/questions/48164362/working-with-multipeerconnectivity-in-ios-swift

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