Question

I am sending a file using multipeer connectivity in ios7 in this way:

[browser invitePeer:key
                              toSession:session
                            withContext:myData
                                timeout:interval];

and the other user receives it in this way:

- (void) advertiser:(MCNearbyServiceAdvertiser *)advertiser
didReceiveInvitationFromPeer:(MCPeerID *)peerID
    withContext:(NSData *)context
 invitationHandler:(void(^)(BOOL accept,
                          MCSession *session))invitationHandler{

The problem is that some files are big e.g. 30mb and take a while. I would like to have some kind of progress tracking. Is this possible?

Was it helpful?

Solution

An NSProgress is passed with the delegate methods

– session:didStartReceivingResourceWithName:fromPeer:withProgress:

Which can be used to track progress until

– session:didFinishReceivingResourceWithName:fromPeer:atURL:withError:

is called

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top