Our product (rockhawk.ca) uses the Multipeer Connectivity framework for peer-to-peer communication between multiple iOS/iPadOS devices. My understanding is that MC framework communicates via three methods: 1) infrastructure wifi (i.e. multiple iOS/iPadOS devices are connected to the same wifi network), 2) peer-to-peer wifi, or 3) Bluetooth. In my experience, I don't believe I've seen MC use Bluetooth. With wifi turned off on the devices, and Bluetooth turned on, no connection is established. With wifi on and Bluetooth off, MC works and I presume either infrastructure wifi (if available) or peer-to-peer wifi are used.
I'm trying to overcome two issues:
-
Over time (since iOS 9.x), the radio transmit strength for MC over peer-to-peer wifi has decreased to the point that range is unacceptable for our use case. We need at least 150 feet range.
-
We would like to extend this support to watchOS and the MC framework is not available.
Regarding #1, I'd like to confirm that if infrastructure wifi is available, MC uses it. If infrastructure wifi is not available, MC uses peer-to-peer wifi. If this is true, then we can assure our customers that if infrastructure wifi is available at the venue, then with all devices connected to it, range will be adequate.
If infrastructure wifi is not available at the venue, perhaps a mobile wifi router (battery operated) could be set up, devices connected to it, then range would be adequate. We are about to test this. Reasonable?
Can we be assured that if infrastructure wifi is available, MC uses it?
Regarding #2, given we are targeting minimum watchOS 7.0, would the available networking APIs and frameworks be adequate to implement our own equivalent of the MC framework so our app on iOS/iPadOS and watchOS devices could communicate? How much work? Where would I start? I'm new to implementing networking but experienced in using the MC framework. I'm assuming that I would write the networking code to use infrastructure wifi to achieve acceptable range.
Many thanks!
Tim
My understanding is that MC framework communicates via three methods
Nope. Multipeer Connectivity hasn’t used Bluetooth since… gosh… I think it was iOS 11.
Regarding #1, I'd like to confirm that if infrastructure wifi is available, MC uses it.
That’s correct.
Regarding #2, given we are targeting minimum watchOS 7.0
Multipeer Connectivity is not available on watchOS.
As to what you can do about that, I see two key questions:
-
How do you implement the equivalent of Multipeer Connectivity?
-
Will that actually help on watchOS?
Lemme tackle the second one first. Have you read TN3135 Low-level networking on watchOS? Any Multipeer Connectivity replacement would necessarily use low-level networking APIs, and thus would be affected by this.
Beyond that, I’m not actually sure if peer-to-peer Wi-Fi is available on watchOS. I’ve never had anyone ask about this because the previous point rules out most use cases for it.
As to how you’d replace Multipeer Connectivity, I wanna be clear that it’s worth doing that regardless of watchOS. Multipeer Connectivity has significant performance and reliability problems and, while I can’t predict the future with 100% accuracy, the fact that we haven’t fixed them in the last N years should tell you something.
TN3151 Choosing the right networking API touches on this topic. The best approach to replace Multipeer Connectivity depends on which of its features you’re using. For example, I find that a lot of developers naturally gravitate towards the client/server networking model. That’s not well supported by Multipeer Connectivity, but it is well supported by Network framework. So, if you’re current product uses a client/server architecture, you might find that Network framework is easier.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"