SKYLINKConnection Class Reference
Inherits from | NSObject |
Declared in | SKYLINKConnection.h |
Tasks
Delegates
-
lifeCycleDelegate
property -
remotePeerDelegate
property -
mediaDelegate
property -
messagesDelegate
property -
fileTransferDelegate
property
Lifecycle
-
– initWithConfig:apiKey:
-
– connectToRoomWithSecret:roomName:userInfo:
-
– connectToRoomWithCredentials:roomName:userInfo:
-
– disconnect
Media
Messaging
File Transfer
-
– sendFileTransferRequest:assetType:peerId:
-
– sendFileTransferRequest:assetType:
-
– acceptFileTransfer:filename:peerId:
-
– cancelFileTransfer:peerId:
Miscellaneous
Utility
Properties
fileTransferDelegate
delegate related to file transfer.
@property (nonatomic, weak) id<SKYLINKConnectionFileTransferDelegate> fileTransferDelegate
Declared In
SKYLINKConnection.h
lifeCycleDelegate
delegate related to life cycle.
@property (nonatomic, weak) id<SKYLINKConnectionLifeCycleDelegate> lifeCycleDelegate
Declared In
SKYLINKConnection.h
mediaDelegate
delegate related to audio/video media.
@property (nonatomic, weak) id<SKYLINKConnectionMediaDelegate> mediaDelegate
Declared In
SKYLINKConnection.h
Class Methods
calculateCredentials:duration:startTime:secret:
Calculate credentials to be used by the connection.
+ (NSString *)calculateCredentials:(NSString *)roomName duration:(CGFloat)duration startTime:(NSDate *)startTime secret:(NSString *)secret
Parameters
- roomName
Name of the room.
- duration
Duration of the call in hours.
- startTime
Start time of the call as per client application time zone.
- secret
The shared secret.
Return Value
The calculated credentials.
Declared In
SKYLINKConnection.h
Instance Methods
acceptFileTransfer:filename:peerId:
Accept or reject the file transfer request from the peer.
- (void)acceptFileTransfer:(BOOL)accept filename:(NSString *)filename peerId:(NSString *)peerId
Parameters
- accept
Flag to specify whether the request is accepted.
- filename
The name of the file in request.
- peerId
The unique id of the peer from whom the file data would be coming.
Declared In
SKYLINKConnection.h
cancelFileTransfer:peerId:
Cancel the existing on going transfer at anytime.
- (void)cancelFileTransfer:(NSString *)filename peerId:(NSString *)peerId
Parameters
- filename
The name of the file in request.
- peerId
The unique id of the peer from whom the file data is coming.
Declared In
SKYLINKConnection.h
connectToRoomWithCredentials:roomName:userInfo:
Join the room specifiying the calculated credential info, room name and user info.
- (NSString *)connectToRoomWithCredentials:(NSDictionary *)credInfo roomName:(NSString *)roomName userInfo:(id)userInfo
Parameters
- credInfo
A dictionary containing a credential, startTime and duration.
- roomName
Name of the room to join.
- userInfo
User defined information. May be an NSString, NSDictionary or NSArray.
Return Value
nil if connection can be established otherwise a message specifying reason for connection denial.
Discussion
The dictionary ‘credInfo’ is supposed to have 3 non-Null parameters an NSString type ‘credential’, an NSDate type ‘startTime’ and a float type ‘duration’ in hours. The ‘startTime’ must be a correct time of the client application’s timezone. Both the ‘startTime’ and ‘duration’ must be the same as the ones that were used to calculate the credentils. Failing to provide any of them will result in a connection denial.
Declared In
SKYLINKConnection.h
connectToRoomWithSecret:roomName:userInfo:
Join the room specifiying the shared secret, room name and user info.
- (BOOL)connectToRoomWithSecret:(NSString *)secret roomName:(NSString *)roomName userInfo:(id)userInfo
Parameters
- secret
Shared secret.
- roomName
Name of the room to join.
- userInfo
User defined information. May be an NSString, NSDictionary or NSArray.
Return Value
NO if a connection is already established.
Discussion
We recommend using connectToRoomWithCredentials:roomName:userInfo: but if the client application has no server implementation then one may better use this one.
Declared In
SKYLINKConnection.h
getUserInfo:
Get the cached user info for a particular peer.
- (id)getUserInfo:(NSString *)peerId
Parameters
- peerId
The unique id of the peer.
Return Value
User defined information. May be an NSString, NSDictionary or NSArray.
Declared In
SKYLINKConnection.h
initWithConfig:apiKey:
Initialize and return a newly allocated connection object.
- (id)initWithConfig:(SKYLINKConnectionConfig *)config apiKey:(NSString *)apiKey
Parameters
- config
The connection configuration object.
- apiKey
API key.
Discussion
Changes in config after creating the object won’t effect the connection itself.
Declared In
SKYLINKConnection.h
muteAudio:
Mutes own audio and triggers mute audio call back at all participants.
- (void)muteAudio:(BOOL)isMuted
Parameters
- isMuted
Flag to impare muted audio condition.
Declared In
SKYLINKConnection.h
muteVideo:
Mutes own video and triggers mute video call back at all participants.
- (void)muteVideo:(BOOL)isMuted
Parameters
- isMuted
Flag to impare muted video condition.
Declared In
SKYLINKConnection.h
reportRotation
Let the SDK know that the interface orientation of the application has been changed.
- (void)reportRotation
Discussion
One should call this function to let the SDK know about the interface rotation changes so that the SDK can adjust the self video capturing accordingly.
Declared In
SKYLINKConnection.h
sendCustomMessage:peerId:
Send a custom message (dictionary, array or string) to a remotePeer.
- (void)sendCustomMessage:(id)message peerId:(NSString *)peerId
Parameters
- message
User defined message to be sent to the peer. May be an NSString, NSDictionary or NSArray.
- peerId
The unique id of the peer to whom the message would be sent.
Discussion
If the ‘remotePeerId’ is not given it will be assumed as a broadcast message to all users.
Declared In
SKYLINKConnection.h
sendDCMessage:peerId:
Send a message via data channel.
- (void)sendDCMessage:(id)message peerId:(NSString *)peerId
Parameters
- message
User defined message to be sent to the peer. May be an NSString, NSDictionary, NSArray.
- peerId
The unique id of the peer to whome the message would be sent.
Discussion
The message will be broadcasted to all the users if the remotePeerId is sent as ‘nil’.
Declared In
SKYLINKConnection.h
sendFileTransferRequest:assetType:
This will trigger a broadcast file permission event on the remote peer.
- (void)sendFileTransferRequest:(NSURL *)fileURL assetType:(SKYLINKAssetType)assetType
Parameters
- fileURL
The url of the file to send.
- assetType
The type of the asset to send.
Discussion
If all the data channel connections are busy in some file transfer then this message will be ignored. If one or more data channel connections are not busy in some file transfer then this will trigger a broadcast file permission event on the available remote peers.
Declared In
SKYLINKConnection.h
sendFileTransferRequest:assetType:peerId:
This will trigger a file permission event on the remote peer.
- (void)sendFileTransferRequest:(NSURL *)fileURL assetType:(SKYLINKAssetType)assetType peerId:(NSString *)peerId
Parameters
- fileURL
The url of the file to send.
- assetType
The type of the asset to send.
- peerId
The unique id of the peer to whom the file would be sent.
Exceptions
- exception
An exception will be raised if there is already a file transfer being done with the same peer.
Declared In
SKYLINKConnection.h