Questions tagged [mcsession]

An MCSession object enables and manages communication among all peers in a Multipeer Connectivity session

39 questions
19
votes
3 answers

Multipeer Connectivity: Invalid service type

I am trying to use the Multipeer Connectivity framework but I am getting a crash while trying to instantiate MCNearbyServiceBrowser with a serviceType called "stc-classroom-vik". Here is the code: private func setUpSession() { self.session =…
Vik Singh
  • 1,563
  • 2
  • 19
  • 36
14
votes
2 answers

Convert incoming NSStream to View

I'm successfully sending a stream of NSData. The delegate method below is getting that stream and appending to NSMutableData self.data. How do I take this data and make it into a UIView/AVCaptureVideoPreviewLayer (which should show video)? I feel…
Eric
  • 4,063
  • 2
  • 27
  • 49
13
votes
0 answers

How do connections and relaying work in MCSessions?

The Multipeer Connectivity Framework documentation is a bit lacking. Below I have several questions about connections and relaying. In order to make things easier, I created an image for each question. The legend is as follows: For each of the…
Senseful
  • 86,719
  • 67
  • 308
  • 465
6
votes
1 answer

Multipeer Connectivity - Get file transfer(Internet) speed and File Size in Swift 5

I am transferring photo peer to peer. All things works fine but I am not able to get the photo(file) transfer speed i.g internet speed. Like MB the file is transferred. Second I want to fetch the size of that file. We are passing photo in data…
Yogesh Patel
  • 1,893
  • 1
  • 20
  • 55
3
votes
1 answer

Set the maximum peers in MCSession

I'm sending files between devices using the framework MultipeerConnectivity. I learned that by default this framework can connect with up to 8 devices, so in my case I would like to reduce this to only 2 devices (which in this case is mine and the…
LettersBa
  • 747
  • 1
  • 8
  • 27
3
votes
0 answers

Certificate In iOS McSEssion

In iOS MCSession, you can initialize the section using the following method initWithPeer:securityIdentity:encryptionPreference: Most online tutorials the authors put nil for securityIdentity. However, I wonder whether any damage (hacked) if leaving…
willSapgreen
  • 1,365
  • 2
  • 17
  • 27
2
votes
2 answers

MCSessionState changes from connecting to not connected state

Whenever I try to connect a peer using the Multipeer Connectivity Framework, the peer's state changes from MCSessionState.Connecting to MCSessionState.NotConnected. Here are the order of events I run: The simulator advertises the service via an…
Senseful
  • 86,719
  • 67
  • 308
  • 465
2
votes
1 answer

Inviting Peer to MCSEssion

This is my first time posting on stackoverflow, and I'm aware of the strict posting requirements. Please let me know if I'm not following any of the guidelines. I'm currently writing an IOS (8.4) application in Xcode, using Objective-C. The goal…
Austin
  • 79
  • 1
  • 6
2
votes
2 answers

Multipeer Connectivity send and receive NSManagedObject

I'm looking to send and receive an NSManagedObject through the multipeer connectivity framework. class MyObject: NSManagedObject { @NSManaged var name: String @NSManaged var children: NSSet } I've managed to send strings and dictionaries, but I…
2
votes
0 answers

Multipeer Connectivity: why connecting to Peer sometimes fails?

When i send an invite and the other side accepts, the remote peer changes state to connecting, but then SOMETIMES to ('not connected') Peer [Peter’s MacBook Air] changed state to Connecting Peer [Peter’s MacBook Air] changed state to Not…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
2
votes
1 answer

Trying to use NSNotification in a multipeer connectivity test app in Swift

have been following this tutorial : http://www.appcoda.com/intro-multipeer-connectivity-framework-ios-programming/ But have been converting it to work in Swift. Have come unstuck on the following however…
Franco
  • 23
  • 5
2
votes
2 answers

MCSession takes a long time to dealloc

I'm using Multipeer-Connectivity. When the session ends, the app comes to the main menu and all network stuff is released then deallocated. But my dealloc method is called in main thread and the MCSession object takes a very long time to release…
Martin
  • 11,881
  • 6
  • 64
  • 110
1
vote
0 answers

Bonjour trouble using iOS 15, detecting "Local Network" setting

Starting with iOS 15 (and maybe iOS 14), I had been having trouble getting Bonjour to work (it's working now). I am using MCSession, MCAdvertiserAssistant, and MCNearbyServiceBrowser. None of my delegate methods were being triggered. It was radio…
Jeff
  • 2,659
  • 1
  • 22
  • 41
1
vote
1 answer

Can't unarchive custom Object with NSKeyedUnarchiver in AR Multiuser

I'm using MultipeerConnectivity to share SCNNodes position in a multiuser AR session. When I archive (with NSKeyedArchiver.archivedData(withRootObject: someARNode, requiringSecureCoding: true) ) And unarchive (with if let node = try…
1
vote
0 answers

Swift: MCSession connecting, but never fully connects

I have a object in swift that manages MCSessions and connects to any that it finds. However, there always seems to be some issue so that while it is connecting to the session, it disconnects. func browser(browser: MCNearbyServiceBrowser, foundPeer…
Jack Roper
  • 11
  • 2
1
2 3