SKYLINKConnectionFileTransferDelegate Protocol Reference

Conforms to NSObject
Declared in SKYLINKConnection.h

Overview

Delegate methods are called on the main thread.

– connection:didReceiveRequest:peerId:

Called upon receiving a file transfer request from a peer.

- (void)connection:(nonnull SKYLINKConnection *)connection didReceiveRequest:(null_unspecified NSString *)filename peerId:(null_unspecified NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didReceivePermission:filename:peerId:

Called upon receiving a file transfer permission from a peer.

- (void)connection:(nonnull SKYLINKConnection *)connection didReceivePermission:(BOOL)isPermitted filename:(null_unspecified NSString *)filename peerId:(null_unspecified NSString *)peerId

Parameters

connection

The underlying connection object.

isPermitted

Flag to specify whether the request was accepted.

filename

The name of the file in request.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didDropTransfer:reason:isExplicit:peerId:

Called when the file being transferred is halted.

- (void)connection:(nonnull SKYLINKConnection *)connection didDropTransfer:(null_unspecified NSString *)filename reason:(null_unspecified NSString *)message isExplicit:(BOOL)isExplicit peerId:(null_unspecified NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

message

The message specifying reason for the file transfer drop.

isExplicit

Flag to specify whether the transfer was halted explicity by the sender.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didUpdateProgress:isOutgoing:filename:peerId:

Called upon every file transfer progress update.

- (void)connection:(nonnull SKYLINKConnection *)connection didUpdateProgress:(CGFloat)percentage isOutgoing:(BOOL)isOutgoing filename:(null_unspecified NSString *)filename peerId:(null_unspecified NSString *)peerId

Parameters

connection

The underlying connection object.

percentage

The perccentage representing the progress of the transfer (CGFloat from 0 to 1).

isOutgoing

Boolean to specify if the transfer is a file beign sent (value would be YES) or received (value would be NO).

filename

The name of the file in transmission.

peerId

The unique id of the peer thie file is sent to or received from.

Discussion

Alternatively, if many of your objects need to get these informations, it can register to the notification with identifier: @“SKYLINKFileProgress”.

Declared In

SKYLINKConnection.h

– connection:didCompleteTransfer:fileData:peerId:

Called upon file transfer completion.

- (void)connection:(nonnull SKYLINKConnection *)connection didCompleteTransfer:(null_unspecified NSString *)filename fileData:(null_unspecified NSData *)fileData peerId:(null_unspecified NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

fileData

NSData object holding the data transferred.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h