9 #import <Foundation/Foundation.h> 11 NS_ASSUME_NONNULL_BEGIN
20 typedef NS_ENUM(NSInteger, CoConnectionEvent) {
40 typedef NS_ENUM(NSInteger, CoDataType) {
81 - (id)initWithToken:(NSString *)token myDeviceId:(NSString *)myDeviceId;
95 - (
CoError)sendMsg:(NSString *)msg toOtherDeviceId:(NSString *)otherDeviceId;
103 - (
CoError)connectToOtherDeviceId:(NSString *)otherDeviceId;
124 - (
CoError)sendVideoH264Frame:(NSData *)h264Frame;
132 - (
CoError)sendVideoH264DataChunk:(NSData *)h264DataChunk;
140 - (
CoError)sendAudioFrames:(NSData *)audioFrames;
148 - (
CoError)sendOtherData:(NSData *)data;
160 - (void)registerPushNotificationsFromDevice:(NSString *)otherDeviceId myDeviceToken:(NSString *)myDeviceToken;
170 - (
CoError)sendPushNotificationMsg:(NSString *)msg action:(NSString *)action;
172 @property (nonatomic, weak) id<CjConnectivityDelegate> delegate;
185 - (void)msgReceived:(NSString *)msg otherDeviceId:(NSString *)otherDeviceId;
203 - (void)dataReceived:(NSData *)data dataType:(CoDataType)dataType otherDeviceId:(NSString *)otherDeviceId connectionType:(
CoConnectionType)connectionType;
208 NS_ASSUME_NONNULL_END
Encompasses all connection types (such as for example when receiving and overall timeout event).
Definition: CjConnectivityInterface.h:55
It took too long to attempt the connection. Perhaps the other device is not connected to the network.
Definition: CjConnectivityInterface.h:32
Already attempted the maximum number of connections allowed.
Definition: CjConnectivityInterface.h:33
Network conditions are not good enough for current bitrate. Reduce the video resolution/bitrate when ...
Definition: CjConnectivityInterface.h:22
CoConnectionEvent
CoConnectionEvent gives information about events occurring with a specific connection.
Definition: CjConnectivityInterface.h:20
No associated connection type.
Definition: CjConnectivityInterface.h:51
Peer-to-peer connection over the public internet.
Definition: CjConnectivityInterface.h:53
CoConnectionType
The CoConnectionType indicates what kind of connection we are dealing with (direct local connection,...
Definition: CjConnectivityInterface.h:50
Something is wrong with the token provided.
Definition: CjConnectivityInterface.h:30
Connection via relay server.
Definition: CjConnectivityInterface.h:54
Received a connection request and started initiating connection.
Definition: CjConnectivityInterface.h:27
Already attempted the maximum number of connections allowed.
Definition: CjConnectivityInterface.h:72
Attempted to reconnect more quickly than minimum interval tied to this token. Contact support@seajei....
Definition: CjConnectivityInterface.h:73
Got disconnected because of a network change (such as network lost for example).
Definition: CjConnectivityInterface.h:24
An input parameter is bad.
Definition: CjConnectivityInterface.h:64
CoError
Most methods will return an CoError code. The code indicates success or what type of failure happened...
Definition: CjConnectivityInterface.h:61
Peer sent disconnection request.
Definition: CjConnectivityInterface.h:26
Trying to call functions that need initialization first.
Definition: CjConnectivityInterface.h:66
BOOL isConnected()
Check if we have a data connection with the other device.
An internal error has occurred.
Definition: CjConnectivityInterface.h:65
void deinit()
Disconnects from other device if needed and deinitializes library.
There was an error with the token.
Definition: CjConnectivityInterface.h:68
The network connection is offline.
Definition: CjConnectivityInterface.h:70
Trying to initialize but we are already initialized.
Definition: CjConnectivityInterface.h:67
The token provided is expired.
Definition: CjConnectivityInterface.h:31
Other device's version is too old and not compatible with this device.
Definition: CjConnectivityInterface.h:35
Connection was successful. Gets received when first of 3 possible connection types gets established.
Definition: CjConnectivityInterface.h:29
Device is ready to receive messages to its unique ID.
Definition: CjConnectivityInterface.h:23
Connection was successful on one of the other two of three connection types (CoConnectionType)....
Definition: CjConnectivityInterface.h:28
The token used has a session maximum time limit and that limit has been reached. Contact support@seaj...
Definition: CjConnectivityInterface.h:36
Success return value. No error occurred.
Definition: CjConnectivityInterface.h:62
A generic error. Not enough information for a specific error code.
Definition: CjConnectivityInterface.h:63
Network conditions are good enough for a higher bitrate than the one currently used....
Definition: CjConnectivityInterface.h:21
Definition: CjConnectivityInterface.h:176
Peer stopped responding, indicating that peer either crashed or lost its network connection.
Definition: CjConnectivityInterface.h:25
void disconnect()
Disconnects from other device.
Token status is expired.
Definition: CjConnectivityInterface.h:69
This device's version is too old and not compatible with other device.
Definition: CjConnectivityInterface.h:34
Connection over same local network.
Definition: CjConnectivityInterface.h:52
The data connection is disconnected.
Definition: CjConnectivityInterface.h:71
Definition: CjConnectivityInterface.h:15