Multipeer Connectivity

RSS for tag

Support peer-to-peer connectivity and the discovery of nearby devices using MultipeerConnectivity.

Multipeer Connectivity Documentation

Posts under Multipeer Connectivity tag

33 Posts
Sort by:
Post not yet marked as solved
1 Replies
553 Views
Now'sample can connected with one Third-Party Accessory to receive periodic measurements of its distance,I want to connect four accessories(not iPhone) to receive their distance and direction at the same time ,How to do that. please tell me if you know how to do that,thank you very much!
Posted
by JANG123.
Last updated
.
Post not yet marked as solved
0 Replies
352 Views
When I checked the NearbyInteraction Accessory Protocol Specification, the sequence diagram in Section 2.4 stated (1) Establish a data link (ieBLE, LAN, Cloud, or other). However, in the sample code, there is no communication method setting for establishing the data link. Since it is described in the specification, it means that there is an arbitrary establishment method but the implementation method has not been released yet, or it is necessary to contact Apple at the time of product development and request disclosure of the specification. Please tell me who knows.
Posted
by keik.
Last updated
.
Post not yet marked as solved
1 Replies
303 Views
Is it possible to use the Multipeer Connectivity framework for a messaging service? For example a user provides permission for the application to occasionally run in the background like other apps so that the application can forward messages and data to the intended recipients. I am under the impression this is how the Find My network behaves so I was curious if similar functionality could be achieved with this framework. Or is the Multipeer Connectivity framework solely for user-centric activities where sessions must be started and maintained with foreground app usage.
Posted
by nomonomad.
Last updated
.
Post not yet marked as solved
0 Replies
259 Views
I am building an app using MultipeerConnectivity with 2 iPhones. The app needs low latency real-time networking. When I was measuring the round trip time (RTT), I found that the RTT is very unstable. What I did in code was that I send a ping message from device A to device B and record the current system uptime ([[NSProcessInfo processInfo] systemUptime]) on device A. When device B receives the ping message, it immediately sends a pong message back to device A. When device A receives the pong message, the RTT is calculated by RTT = (current system uptime - previously recorded system uptime) * 1000 I sent the ping message every 2 seconds from device A to device B and got the following RTT result: rtt 8.7917 rtt 156.9327 rtt 251.2976 rtt 3.9905 rtt 6.2492 rtt 5.3590 rtt 96.0188 rtt 190.8776 rtt 291.0668 rtt 7.0962 rtt 6.8734 rtt 43.4346 rtt 227.1793 rtt 235.7925 rtt 336.1445 rtt 10.1862 rtt 14.6641 rtt 100.1742 rtt 194.9736 rtt 294.0715 rtt 5.0174 rtt 5.5357 rtt 65.7211 You might have noticed the pattern, it is a loop! At the beginning, the RTT is very low (around 5 ms), which is good. But after a short period of time (about 5 seconds), it gradually increases and finally hits a peak value of around 300 ms. Then it immediately drops to around 5 ms and the loop repeats again. I didn't send any other message between these two devices, only ping pong messages were transmitted. This is very weird to me, since it is stably unstable... Is that supposed to happen because of the nature of MultipeerConnectivity? Is that possible to make MultipeerConnectivity network stable with a low RTT (around 5ms)? Thank you very much!
Posted
by yuchenz27.
Last updated
.
Post not yet marked as solved
0 Replies
475 Views
After upgrading to IOS15, I'm getting disconnects using multipeer connect when the network is not in use. Sending manual keep alive messages every second seems to prevent this from happening. This only occurs when devices are connected directly and not via wifi infrastructure Has the underlying implementation of MultipeerConnect changed in IOS15 (ie no longer NSNetService)?
Posted
by corin.
Last updated
.
Post not yet marked as solved
1 Replies
595 Views
By referencing to the Developer Forums, we could handle multiple concurrent sessions using iphone11. The maximum number of concurrent sessions is two. When we try to connect another one devices, session(_:didInvalidateWith:) on the NISessionDelegate is called with NIError.Code.activeSessionsLimitExceeded. I'd like to know three or more concurrent sessions are running using newer version like iphone12. Does anyone have any knowledge?
Posted
by GPSMRI.
Last updated
.
Post not yet marked as solved
1 Replies
327 Views
I get the following error when configuring MCBrowserViewController to look for nearby peers. And this is despite appending the required info in info.plist namely, [MCNearbyServiceBrowser] NSNetServiceBrowser did not search with error dict [{     NSNetServicesErrorCode = "-72008";     NSNetServicesErrorDomain = 10; }]. NSLocalNetworkUsageDescription <string>Need permission to discover and connect to My Service running on peer iOS device</string> NSBonjourServices <array> <string>_my-server._tcp</string> <string>_my-server._udp</string> </array> Here is my code: let browser = MCBrowserViewController(serviceType: "my-server", session: session)             browser.delegate = self             browser.minimumNumberOfPeers = kMCSessionMinimumNumberOfPeers             browser.maximumNumberOfPeers = 1             self.present(browser, animated: true, completion: nil)
Posted Last updated
.
Post not yet marked as solved
1 Replies
326 Views
Hey I wanna make an app where I am able to have users create a room and invite other users using some invite link or room code I was wondering if anyone can give me pointers on how to do this? An example of my UI is below. Creating the UI shouldnt be too hard its just trying to find how to group users together.
Posted Last updated
.
Post marked as solved
3 Replies
393 Views
Is there a way to increase the range of MultipeerConnectivity WIFI? I have read a few posts answered by @eskimo at Apple which states that a range over 5 meters is probably to long. "Given the way that Apple’s peer-to-peer Wi-Fi is currently implemented, there’s a tradeoff between range and connection setup reliability. The longer the range, the harder it is for the system to set up the connection. To help with this Apple uses very low transmission power for peer-to-peer Wi-Fi. This reduces the effective range but makes connection setup much more reliable. So the range you’re testing at, 5 metres, is actually quite long range for peer-to-peer Wi-Fi." I am trying to write a rear view mirror app for my 7 meter long Motorhome using MultipeerConnectivity and although I can get an iPhone at the back of the motorhome to transmit video to an iPhone at the front of the motorhome attached to the rear view mirror which displayed the live video, the connection gets dropped quite regularly. Is there a way to boost the signal by another 50% once I have made the connection which I can initially do with the iPhones in close proximity?
Posted
by RobinL.
Last updated
.
Post marked as solved
2 Replies
444 Views
Hi, I'm trying to use the Multipeer Connectivity framework in my latest app to create a mesh network between many devices (20+). I only plan to have each device connected to at most 4 other devices to avoid the limitations of the MC framework. However, when testing it out I found that when connecting multiple peers together, the MCSessions seemed to sync up. I.e. when I had device 1 connect to device 2, and then device 1 connect to device 3, automatically device 2 would connect to device 3. Is there any way to prevent these automatic connections from forming between devices? I am using swift 5 / iOS 14 Thanks
Posted
by kfreitag.
Last updated
.
Post marked as solved
1 Replies
720 Views
Hi, I've been trying to make an app that can connect to more than one UWB source at a time. I've three iPhone 12 Pro and I am using NearbyInteraction to retrieve the distance and direction from one iPhone to the other. I've used MultipeerConnectivity to share the discovery tokens from all devices. My code at the moment can perfectly handle two devices sharing their distance and direction, but at soon as I connect the third phone, all sharing stops. I am wondering if I am doing something wrong or if there is a limitation on Apple side to prevent devices from retrieving the distance and direction from more than one source at a time. I am not giving too much detail about my implementation yet, but don't hesitate to ask questions about it. Thanks in advance for your help.
Posted
by Minoo555.
Last updated
.
Post not yet marked as solved
1 Replies
410 Views
Hi I have a peer to peer VoIP application supposed to work without Internet access. Everything works fine except incoming calls reception while in background. I know that the recommended approach for VoIP applications is to use push notifications, but this is not an option for this application. Are there other options to receive incoming calls while in background ? thank you Bogdan
Posted
by cristeab.
Last updated
.