简体   繁体   English

如何通过蓝牙获取附近的ios设备信息

[英]how to get ios devices' information nearby with Bluetooth

How could I set the ios devices' (iphone & ipad) bluetooth visible for other ios devices when turn the bluetooth on? 打开蓝牙时,如何设置其他设备的ios设备(iphone和ipad)蓝牙可见? I just want to get and show all the ios devices' name (MFI devices include) nearby in my app when all devices' bluetooth on, and I also want to get devices' deviceID. 当所有设备的蓝牙都打开时,我只想获取并显示我的应用程序附近所有ios设备的名称(包括MFI设备),我也想获取设备的deviceID。 I have succed using GameKit.framework to connect two ios devices by using bluetooth, but this requires the two devices run that app together. 我已经成功使用GameKit.framework通过使用蓝牙连接了两个ios设备,但这需要两个设备一起运行该应用程序。 Could some one provide me suggest on how to implement it? 有人可以建议我如何实施它吗? Thank you very much! 非常感谢你!

I'm not exactly sure what you are asking. 我不确定您要问什么。 Setting a device's bluetooth on is not enough. 仅打开设备的蓝牙是不够的。 A device needs to be advertising for peers to detected it. 设备需要向对等方通告以检测到它。 I think this might be related to what you are trying to do: http://www.ralfebert.de/tutorials/ios-swift-multipeer-connectivity/ . 我认为这可能与您要执行的操作有关: http : //www.ralfebert.de/tutorials/ios-swift-multipeer-connectivity/

I tried this tutorial and it was very helpful. 我尝试了本教程,它非常有帮助。 It uses Multipeer Connectivity to advertise and browse for peers around. 它使用Multipeer Connectivity进行广告和浏览以寻找周围的对等点。 It also displays the deviceID of devices around you. 它还显示您周围设备的deviceID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM