SKYLINKConnection Class Reference
| Inherits from | NSObject |
| Declared in | SKYLINKConnection.h |
Tasks
Delegates
-
lifeCycleDelegateproperty -
remotePeerDelegateproperty -
mediaDelegateproperty -
messagesDelegateproperty -
fileTransferDelegateproperty
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> fileTransferDelegateDeclared In
SKYLINKConnection.hlifeCycleDelegate
delegate related to life cycle.
@property (nonatomic, weak) id<SKYLINKConnectionLifeCycleDelegate> lifeCycleDelegateDeclared In
SKYLINKConnection.hmediaDelegate
delegate related to audio/video media.
@property (nonatomic, weak) id<SKYLINKConnectionMediaDelegate> mediaDelegateDeclared In
SKYLINKConnection.hClass 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 *)secretParameters
- 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.hInstance Methods
acceptFileTransfer:filename:peerId:
Accept or reject the file transfer request from the peer.
- (void)acceptFileTransfer:(BOOL)accept filename:(NSString *)filename peerId:(NSString *)peerIdParameters
- 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.hcancelFileTransfer:peerId:
Cancel the existing on going transfer at anytime.
- (void)cancelFileTransfer:(NSString *)filename peerId:(NSString *)peerIdParameters
- 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.hconnectToRoomWithCredentials:roomName:userInfo:
Join the room specifiying the calculated credential info, room name and user info.
- (NSString *)connectToRoomWithCredentials:(NSDictionary *)credInfo roomName:(NSString *)roomName userInfo:(id)userInfoParameters
- 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.hconnectToRoomWithSecret:roomName:userInfo:
Join the room specifiying the shared secret, room name and user info.
- (BOOL)connectToRoomWithSecret:(NSString *)secret roomName:(NSString *)roomName userInfo:(id)userInfoParameters
- 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.hgetUserInfo:
Get the cached user info for a particular peer.
- (id)getUserInfo:(NSString *)peerIdParameters
- peerId
The unique id of the peer.
Return Value
User defined information. May be an NSString, NSDictionary or NSArray.
Declared In
SKYLINKConnection.hinitWithConfig:apiKey:
Initialize and return a newly allocated connection object.
- (id)initWithConfig:(SKYLINKConnectionConfig *)config apiKey:(NSString *)apiKeyParameters
- 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.hmuteAudio:
Mutes own audio and triggers mute audio call back at all participants.
- (void)muteAudio:(BOOL)isMutedParameters
- isMuted
Flag to impare muted audio condition.
Declared In
SKYLINKConnection.hmuteVideo:
Mutes own video and triggers mute video call back at all participants.
- (void)muteVideo:(BOOL)isMutedParameters
- isMuted
Flag to impare muted video condition.
Declared In
SKYLINKConnection.hreportRotation
Let the SDK know that the interface orientation of the application has been changed.
- (void)reportRotationDiscussion
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.hsendCustomMessage:peerId:
Send a custom message (dictionary, array or string) to a remotePeer.
- (void)sendCustomMessage:(id)message peerId:(NSString *)peerIdParameters
- 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.hsendDCMessage:peerId:
Send a message via data channel.
- (void)sendDCMessage:(id)message peerId:(NSString *)peerIdParameters
- 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.hsendFileTransferRequest:assetType:
This will trigger a broadcast file permission event on the remote peer.
- (void)sendFileTransferRequest:(NSURL *)fileURL assetType:(SKYLINKAssetType)assetTypeParameters
- 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.hsendFileTransferRequest:assetType:peerId:
This will trigger a file permission event on the remote peer.
- (void)sendFileTransferRequest:(NSURL *)fileURL assetType:(SKYLINKAssetType)assetType peerId:(NSString *)peerIdParameters
- 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