I have an application which transfer video files from one device to another using Multipeer connectivity. But it is taking too much time even though the file size are smaller.
I am using the below method to transfer file
self.session.sendResource(at: url, withName: name, toPeer: peerID)
Here url is the path of a video file(mp4) which is in temp directory.
The receiving code snippets are
public func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) {
}
public func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) {
}
Is there any reason for the slowness ? I tried with multiple WiFi routers but same issue. I also tried enabling and disabling blootooth as some of the old post mentioned that it was one of the reason.