[SOLVED] Configuring Multipeer Connectivity to use a medium of connection between macOS and iOS


I’m using the multipeer connectivity library to establish a p2p connection between an iOS device and a macOS device. The documentation states:
"In macOS and tvOS, it uses infrastructure Wi-Fi, peer-to-peer Wi-Fi, and Ethernet."

Is there a way to specify the usage of p2p wifi over infrastructure wifi?
If not what are my options for a pure p2p communication between iOS and macOS (other than CoreBluetooth)?



So here’s an answer in case anyone is wondering.

Multipeerconnectivity library is very limited in scope in terms of configurability. We can’t really configure it to use a certain protocol over the other and what medium to use.
The best alternative I’ve found is to create a custom p2p communication with the Apple Network library.
Reference: https://developer.apple.com/documentation/network

Answered By – Alireza Azimi

Answer Checked By – Marilyn (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *