Wi-Fi Direct 和 iOS 支持

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28448274/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 04:47:47  来源:igfitidea点击:

Wi-Fi Direct and iOS Support

iosiphonewifi-direct

提问by Remixed123

I want to use Wi-Fi Directin a solution, but I'm unsure which platforms support it.

我想Wi-Fi Direct在解决方案中使用,但我不确定哪些平台支持它。

Does Wi-Fi Directdepend on iPhone/iOS version?

是否Wi-Fi Direct取决于 iPhone/iOS 版本?

Can I develop an application with Wi-Fi Directfeature on a iPhone 4s with iOS 8.

我可以Wi-Fi Direct在装有 iOS 8 的 iPhone 4s 上开发具有功能的应用程序吗?

回答by Remixed123

It took me a while to find out what is going on, but here is the summary. I hope this save people a lot of time.

我花了一段时间才弄清楚发生了什么,但这里是摘要。我希望这可以为人们节省很多时间。

Apple are not playing nice with Wi-Fi Direct, not in the same way that Android is. The Multipeer Connectivity Framework that Apple provides combines both BLE and WiFi Direct together and will only work with Apple devices and not any device that is using Wi-Fi Direct.

Apple 在 Wi-Fi Direct 方面表现不佳,与 Android 的方式不同。Apple 提供的 Multipeer Connectivity Framework 将 BLE 和 WiFi Direct 结合在一起,并且仅适用于 Apple 设备,而不适用于任何使用 Wi-Fi Direct 的设备。

https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html

https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html

It states the following in this documentation - "The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devicesusing infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files)."

它在本文档中声明了以下内容 - “Multipeer Connectivity framework支持发现附近 iOS 设备使用基础设施 Wi-Fi 网络、对等 Wi-Fi 和蓝牙个人区域网络提供的服务,并随后与这些服务进行通信通过发送基于消息的数据、流数据和资源(如文件)。”

Additionally, Wi-Fi direct in this mode between i-Devices will need iPhone 5 and above.

此外,在 i-Device 之间以这种模式直接使用 Wi-Fi 将需要 iPhone 5 及更高版本。

There are apps that use a form of Wi-Fi Direct on the App Store, but these are using their own libraries.

App Store 上有一些使用 Wi-Fi Direct 形式的应用程序,但这些应用程序使用自己的库。

回答by Cameron Lowell Palmer

The official list of current iOS Wi-Fi Management APIs

当前 iOS Wi-Fi 管理 API 的官方列表

There is no Wi-Fi Direct type of connection available. The primary issue being that Apple does not allow programmatic setting of the Wi-Fi network SSID and password. However, this improves substantially in iOS 11 where you can at least prompt the user to switch to another WiFi network.

没有可用的 Wi-Fi Direct 类型的连接。主要问题是 Apple 不允许以编程方式设置 Wi-Fi 网络 SSID 和密码。但是,这在 iOS 11 中得到了显着改善,您至少可以提示用户切换到另一个 WiFi 网络。

QA1942 - iOS Wi-Fi Management APIs

QA1942 - iOS Wi-Fi 管理 API

Entitlement option

权利选项

This technology is useful if you want to provide a list of Wi-Fi networks that a user might want to connect to in a manager type app. It requires that you apply for this entitlement with Apple and the email address is in the documentation.

如果您想在管理器类型的应用程序中提供用户可能想要连接的 Wi-Fi 网络列表,则此技术非常有用。它要求您向 Apple 申请此权利,并且电子邮件地址在文档中。

MFi Program options

MFi 程序选项

These technologies allow the accessory connect to the same network as the iPhone and are not for setting up a peer-to-peer connection.

这些技术允许配件连接到与 iPhone 相同的网络,而不是用于设置点对点连接。

  • Wireless Accessory Configuration (WAC)
  • HomeKit

Peer-to-peer between Apple devices

Apple 设备之间的点对点

These APIs come close to what you want, but they're Apple-to-Apple only.

这些 API 接近您想要的,但它们只是 Apple-to-Apple。

WiTap Example Code

WiTap 示例代码

iOS 11 NEHotspotConfiguration

iOS 11 NEHotspot 配置

Brought up at WWDC 2017 Advances in Networking, Part 1is NEHotspotConfigurationwhich allows the app to specify and prompt to connect to a specific network.

WWDC 2017 Advances in Networking 上提出,第 1 部分NEHotspotConfiguration,它允许应用程序指定并提示连接到特定网络。

回答by Udi Aharoni

According to thisthread:

根据这个线程:

The peer-to-peer Wi-Fi implemented by iOS (and recent versions of OS X) is not compatible with Wi-Fi Direct. Note Just as an aside, you can access peer-to-peer Wi-Fi without using Multipeer Connectivity. The underlying technology is Bonjour + TCP/IP, and you can access that directly from your app. The WiTap sample codeshows how.

iOS(以及最新版本的 OS X)实现的点对点 Wi-Fi 与 Wi-Fi Direct 不兼容。注意 顺便说一句,您可以在不使用 Multipeer Connectivity 的情况下访问对等 Wi-Fi。底层技术是 Bonjour + TCP/IP,您可以直接从您的应用程序访问它。该WiTap示例代码展示了如何。