PeerNetworking

I created an App using PeerNetworking to connect two iOS-Devices without existing wifi-infrastructure. In general the solution works fine but when there are many other smart devices nearby connection gets unstable and breaks, devices have to be closer together or dont connect at all. In "Lab"-conditions everything works fine. What could I do to get the connection more stable and reliable?

Answered by DTS Engineer in 894456022

My general advice for folks using Multipeer Connectivity is to… not. Rather, I encourage folks to movem to Network framework. See Moving from Multipeer Connectivity to Network Framework. This is especially relevant given that Multipeer Connectivity was formally deprecated in Xcode 27 beta.

Having said that, Network framework might only be a partial fix. In the absence of Wi-Fi infrastructure, both Multipeer Connectivity and Network framework rely on the same underlying technology, Apple peer-to-peer Wi-Fi. It has fundamental limitations that can result in problems in crowded Wi-Fi environments. So, while Network framework should help you get more information about the problems, but it might not completely prevent them.

One alternative path is Wi-Fi Aware but:

  • It has more restrictive deployment options.
  • It only supports Network framework.
  • It’s still subject the laws of physics, so it might run into similar problems in crowded environments.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

What specific API are you using? The Multipeer Connectivity framework?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi Quinn yes, I‘m using MultiPeerConnectivity.

private let session : MCSession
private var advertiser : MCNearbyServiceAdvertiser?
private var browser : MCNearbyServiceBrowser?

as described the problems come up in environments with many devices around.

My general advice for folks using Multipeer Connectivity is to… not. Rather, I encourage folks to movem to Network framework. See Moving from Multipeer Connectivity to Network Framework. This is especially relevant given that Multipeer Connectivity was formally deprecated in Xcode 27 beta.

Having said that, Network framework might only be a partial fix. In the absence of Wi-Fi infrastructure, both Multipeer Connectivity and Network framework rely on the same underlying technology, Apple peer-to-peer Wi-Fi. It has fundamental limitations that can result in problems in crowded Wi-Fi environments. So, while Network framework should help you get more information about the problems, but it might not completely prevent them.

One alternative path is Wi-Fi Aware but:

  • It has more restrictive deployment options.
  • It only supports Network framework.
  • It’s still subject the laws of physics, so it might run into similar problems in crowded environments.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

PeerNetworking
 
 
Q