FMLiveSwitchClient Class Reference

A LiveSwitch client. More...

Instance Methods

(void) - addOnApplicationMessage:
 Adds a handler that is raised when an application-scope message is received from the server. More...
 
(FMLiveSwitchClientInfo *, NSString *) - addOnApplicationMessageWithBlock
 Adds a handler that is raised when an application-scope message is received from the server. More...
 
(void) - addOnApplicationMessageWithBlock:
 Adds a handler that is raised when an application-scope message is received from the server. More...
 
(void) - addOnDeviceMessage:
 Adds a handler that is raised when a device-scope message is received from the server. More...
 
(FMLiveSwitchClientInfo *, NSString *) - addOnDeviceMessageWithBlock
 Adds a handler that is raised when a device-scope message is received from the server. More...
 
(void) - addOnDeviceMessageWithBlock:
 Adds a handler that is raised when a device-scope message is received from the server. More...
 
(void) - addOnHttpRequestCreated:
 Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More...
 
(FMLiveSwitchHttpRequestCreatedArgs *) - addOnHttpRequestCreatedWithBlock
 Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More...
 
(void) - addOnHttpRequestCreatedWithBlock:
 Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More...
 
(void) - addOnHttpResponseReceived:
 Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More...
 
(FMLiveSwitchHttpResponseReceivedArgs *) - addOnHttpResponseReceivedWithBlock
 Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More...
 
(void) - addOnHttpResponseReceivedWithBlock:
 Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More...
 
(void) - addOnMessage:
 Adds a handler that is raised when a client-scope message is received from the server. More...
 
(FMLiveSwitchClientInfo *, NSString *) - addOnMessageWithBlock
 Adds a handler that is raised when a client-scope message is received from the server. More...
 
(void) - addOnMessageWithBlock:
 Adds a handler that is raised when a client-scope message is received from the server. More...
 
(void) - addOnRemoteUpdate:
 Adds a handler that is raised when the the client's config on the server has changed. More...
 
(FMLiveSwitchClientInfo *, FMLiveSwitchClientInfo *) - addOnRemoteUpdateWithBlock
 Adds a handler that is raised when the the client's config on the server has changed. More...
 
(void) - addOnRemoteUpdateWithBlock:
 Adds a handler that is raised when the the client's config on the server has changed. More...
 
(void) - addOnStateChange:
 Adds a handler that is raised when the state changes. More...
 
(FMLiveSwitchClient *) - addOnStateChangeWithBlock
 Adds a handler that is raised when the state changes. More...
 
(void) - addOnStateChangeWithBlock:
 Adds a handler that is raised when the state changes. More...
 
(void) - addOnStreamChange:
 Adds a handler that is raised whenever a client disconnects or reconnects to the internet. More...
 
(FMLiveSwitchNetworkConnectionState) - addOnStreamChangeWithBlock
 Adds a handler that is raised whenever a client disconnects or reconnects to the internet. More...
 
(void) - addOnStreamChangeWithBlock:
 Adds a handler that is raised whenever a client disconnects or reconnects to the internet. More...
 
(void) - addOnUserMessage:
 Adds a handler that is raised when a user-scope message is received from the server. More...
 
(FMLiveSwitchClientInfo *, NSString *) - addOnUserMessageWithBlock
 Adds a handler that is raised when a user-scope message is received from the server. More...
 
(void) - addOnUserMessageWithBlock:
 Adds a handler that is raised when a user-scope message is received from the server. More...
 
(NSString *) - applicationId
 Gets the application identifier. More...
 
(NSMutableArray *) - channels
 Gets an array of joined channels. More...
 
(FMLiveSwitchFuture< id > *) - closeAll
 Closes all active connections in all channels. More...
 
(FMLiveSwitchClientConfig *) - config
 Gets the current configuration. More...
 
(NSString *) - deviceAlias
 Gets the device alias. More...
 
(NSString *) - deviceId
 Gets the device identifier. More...
 
(bool) - disableWebSockets
 Gets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests. More...
 
(NSString *) - externalId
 Gets the external client identifier. More...
 
(NSString *) - gatewayUrl
 Gets the gateway URL. More...
 
(NSString *) - id
 Gets the client identifier. More...
 
(FMLiveSwitchClientInfo *) - info
 Gets the client info. More...
 
(instancetype) - initWithGatewayUrl:applicationId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(instancetype) - initWithGatewayUrl:applicationId:userId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(instancetype) - initWithGatewayUrl:applicationId:userId:deviceId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(instancetype) - initWithGatewayUrl:applicationId:userId:deviceId:clientId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(instancetype) - initWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(instancetype) - initWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:region:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchFuture< FMLiveSwitchChannel * > *) - joinWithChannelId:token:
 Joins a channel. More...
 
(FMLiveSwitchFuture< FMLiveSwitchChannel * > *) - joinWithToken:
 Joins a channel. More...
 
(FMLiveSwitchFuture< FMLiveSwitchChannel * > *) - leaveWithChannelId:
 Leaves a channel. More...
 
(long long) - messageBytesReceived
 Gets the number of message bytes received. More...
 
(long long) - messageBytesSent
 Gets the number of message bytes sent. More...
 
(long long) - messagesReceived
 Gets the number of messages received. More...
 
(long long) - messagesSent
 Gets the number of messages sent. More...
 
(NSString *) - region
 Gets the region. More...
 
(FMLiveSwitchFuture< NSMutableArray * > *) - registerWithToken:
 Registers with the signalling server. More...
 
(void) - removeOnApplicationMessage:
 Removes a handler that is raised when an application-scope message is received from the server. More...
 
(void) - removeOnDeviceMessage:
 Removes a handler that is raised when a device-scope message is received from the server. More...
 
(void) - removeOnHttpRequestCreated:
 Removes a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More...
 
(void) - removeOnHttpResponseReceived:
 Removes a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More...
 
(void) - removeOnMessage:
 Removes a handler that is raised when a client-scope message is received from the server. More...
 
(void) - removeOnRemoteUpdate:
 Removes a handler that is raised when the the client's config on the server has changed. More...
 
(void) - removeOnStateChange:
 Removes a handler that is raised when the state changes. More...
 
(void) - removeOnStreamChange:
 Removes a handler that is raised whenever a client disconnects or reconnects to the internet. More...
 
(void) - removeOnUserMessage:
 Removes a handler that is raised when a user-scope message is received from the server. More...
 
(int) - requestMaxRetries
 Gets the maximum number of retries allowed for a standard request. More...
 
(int) - requestTimeout
 Gets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted. More...
 
(NSMutableArray *) - roles
 Gets the roles. More...
 
(FMLiveSwitchFuture< id > *) - sendMessage:
 Sends a message to the server with no delivery. More...
 
(void) - setDeviceAlias:
 Sets the device alias. More...
 
(void) - setDisableWebSockets:
 Sets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests. More...
 
(void) - setExternalId:
 Sets the external client identifier. More...
 
(void) - setRequestMaxRetries:
 Sets the maximum number of retries allowed for a standard request. More...
 
(void) - setRequestTimeout:
 Sets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted. More...
 
(void) - setTag:
 Sets the tag. More...
 
(void) - setUserAlias:
 Sets the user alias. More...
 
(FMLiveSwitchClientState) - state
 Gets the state. More...
 
(NSString *) - tag
 Gets the tag. More...
 
(FMLiveSwitchFuture< id > *) - unregister
 Unregisters with the signalling server. More...
 
(NSException *) - unregisterException
 Gets the unregister exception, which is set if registration is reset abnormally. More...
 
(FMLiveSwitchFuture< id > *) - updateWithClientConfig:
 Updates this client. More...
 
(NSString *) - userAlias
 Gets the user alias. More...
 
(NSString *) - userId
 Gets the user identifier. More...
 
- Instance Methods inherited from FMLiveSwitchDynamic
(NSMutableDictionary< NSString *, id > *) - dynamicProperties
 Gets all dynamic properties on this instance. More...
 
(id- getDynamicValueWithKey:
 Gets a property value from the local cache. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchSerializable class. More...
 
(void) - setDynamicValueWithKey:value:
 Sets a property value in the local cache. More...
 
(bool) - unsetDynamicValueWithKey:
 Removes a property value from the local cache. More...
 

Class Methods

(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:userId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:userId:deviceId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:userId:deviceId:clientId:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
(FMLiveSwitchClient *) + clientWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:region:
 Initializes a new instance of the FMLiveSwitchClient class. More...
 
- Class Methods inherited from FMLiveSwitchDynamic
(FMLiveSwitchDynamic *) + dynamic
 
- Class Methods inherited from FMLiveSwitchSerializable
(FMLiveSwitchSerializable *) + serializable
 Initializes a new instance of the FMLiveSwitchSerializable class. More...
 

Detailed Description

A LiveSwitch client.

Method Documentation

◆ addOnApplicationMessage:

- (void) addOnApplicationMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Adds a handler that is raised when an application-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnApplicationMessageWithBlock

- (FMLiveSwitchClientInfo*, NSString*) addOnApplicationMessageWithBlock

Adds a handler that is raised when an application-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnApplicationMessageWithBlock:

- (void) addOnApplicationMessageWithBlock: (void(^)(FMLiveSwitchClientInfo *, NSString *))  valueBlock

Adds a handler that is raised when an application-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnDeviceMessage:

- (void) addOnDeviceMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Adds a handler that is raised when a device-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnDeviceMessageWithBlock

- (FMLiveSwitchClientInfo*, NSString*) addOnDeviceMessageWithBlock

Adds a handler that is raised when a device-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnDeviceMessageWithBlock:

- (void) addOnDeviceMessageWithBlock: (void(^)(FMLiveSwitchClientInfo *, NSString *))  valueBlock

Adds a handler that is raised when a device-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnHttpRequestCreated:

- (void) addOnHttpRequestCreated: (FMLiveSwitchAction1< FMLiveSwitchHttpRequestCreatedArgs * > *)  value

Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.

This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnHttpRequestCreatedWithBlock

- (FMLiveSwitchHttpRequestCreatedArgs*) addOnHttpRequestCreatedWithBlock

Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.

This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnHttpRequestCreatedWithBlock:

- (void) addOnHttpRequestCreatedWithBlock: (void(^)(FMLiveSwitchHttpRequestCreatedArgs *))  valueBlock

Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.

This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnHttpResponseReceived:

- (void) addOnHttpResponseReceived: (FMLiveSwitchAction1< FMLiveSwitchHttpResponseReceivedArgs * > *)  value

Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.

This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnHttpResponseReceivedWithBlock

- (FMLiveSwitchHttpResponseReceivedArgs*) addOnHttpResponseReceivedWithBlock

Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.

This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnHttpResponseReceivedWithBlock:

- (void) addOnHttpResponseReceivedWithBlock: (void(^)(FMLiveSwitchHttpResponseReceivedArgs *))  valueBlock

Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.

This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ addOnMessage:

- (void) addOnMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Adds a handler that is raised when a client-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnMessageWithBlock

- (FMLiveSwitchClientInfo*, NSString*) addOnMessageWithBlock

Adds a handler that is raised when a client-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnMessageWithBlock:

- (void) addOnMessageWithBlock: (void(^)(FMLiveSwitchClientInfo *, NSString *))  valueBlock

Adds a handler that is raised when a client-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnRemoteUpdate:

- (void) addOnRemoteUpdate: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, FMLiveSwitchClientInfo * > *)  value

Adds a handler that is raised when the the client's config on the server has changed.

◆ addOnRemoteUpdateWithBlock

- (FMLiveSwitchClientInfo*, FMLiveSwitchClientInfo*) addOnRemoteUpdateWithBlock

Adds a handler that is raised when the the client's config on the server has changed.

◆ addOnRemoteUpdateWithBlock:

- (void) addOnRemoteUpdateWithBlock: (void(^)(FMLiveSwitchClientInfo *, FMLiveSwitchClientInfo *))  valueBlock

Adds a handler that is raised when the the client's config on the server has changed.

◆ addOnStateChange:

- (void) addOnStateChange: (FMLiveSwitchAction1< FMLiveSwitchClient * > *)  value

Adds a handler that is raised when the state changes.

◆ addOnStateChangeWithBlock

- (FMLiveSwitchClient*) addOnStateChangeWithBlock

Adds a handler that is raised when the state changes.

◆ addOnStateChangeWithBlock:

- (void) addOnStateChangeWithBlock: (void(^)(FMLiveSwitchClient *))  valueBlock

Adds a handler that is raised when the state changes.

◆ addOnStreamChange:

- (void) addOnStreamChange: (FMLiveSwitchAction1< id > *)  value

Adds a handler that is raised whenever a client disconnects or reconnects to the internet.

◆ addOnStreamChangeWithBlock

- (FMLiveSwitchNetworkConnectionState) addOnStreamChangeWithBlock

Adds a handler that is raised whenever a client disconnects or reconnects to the internet.

◆ addOnStreamChangeWithBlock:

- (void) addOnStreamChangeWithBlock: (void(^)(FMLiveSwitchNetworkConnectionState))  valueBlock

Adds a handler that is raised whenever a client disconnects or reconnects to the internet.

◆ addOnUserMessage:

- (void) addOnUserMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Adds a handler that is raised when a user-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnUserMessageWithBlock

- (FMLiveSwitchClientInfo*, NSString*) addOnUserMessageWithBlock

Adds a handler that is raised when a user-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ addOnUserMessageWithBlock:

- (void) addOnUserMessageWithBlock: (void(^)(FMLiveSwitchClientInfo *, NSString *))  valueBlock

Adds a handler that is raised when a user-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ applicationId

- (NSString*) applicationId

Gets the application identifier.

◆ channels

- (NSMutableArray*) channels

Gets an array of joined channels.

◆ clientWithGatewayUrl:applicationId:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.

◆ clientWithGatewayUrl:applicationId:userId:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.

◆ clientWithGatewayUrl:applicationId:userId:deviceId:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.

◆ clientWithGatewayUrl:applicationId:userId:deviceId:clientId:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.

◆ clientWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId
roles: (NSMutableArray *)  roles 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.
rolesThe roles, if any.

◆ clientWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:region:

+ (FMLiveSwitchClient*) clientWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId
roles: (NSMutableArray *)  roles
region: (NSString *)  region 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.
rolesThe roles, if any.
regionThe region, if any.

◆ closeAll

- (FMLiveSwitchFuture<id>*) closeAll

Closes all active connections in all channels.

◆ config

Gets the current configuration.

◆ deviceAlias

- (NSString*) deviceAlias

Gets the device alias.

Cannot be set after registration, use the 'Update' method instead.

◆ deviceId

- (NSString*) deviceId

Gets the device identifier.

◆ disableWebSockets

- (bool) disableWebSockets

Gets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests.

◆ externalId

- (NSString*) externalId

Gets the external client identifier.

◆ gatewayUrl

- (NSString*) gatewayUrl

Gets the gateway URL.

◆ id

- (NSString*) id

Gets the client identifier.

◆ info

Gets the client info.

◆ initWithGatewayUrl:applicationId:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.

◆ initWithGatewayUrl:applicationId:userId:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.

◆ initWithGatewayUrl:applicationId:userId:deviceId:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.

◆ initWithGatewayUrl:applicationId:userId:deviceId:clientId:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.

◆ initWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId
roles: (NSMutableArray *)  roles 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.
rolesThe roles, if any.

◆ initWithGatewayUrl:applicationId:userId:deviceId:clientId:roles:region:

- (instancetype) initWithGatewayUrl: (NSString *)  gatewayUrl
applicationId: (NSString *)  applicationId
userId: (NSString *)  userId
deviceId: (NSString *)  deviceId
clientId: (NSString *)  clientId
roles: (NSMutableArray *)  roles
region: (NSString *)  region 

Initializes a new instance of the FMLiveSwitchClient class.

Parameters
gatewayUrlThe gateway URL.
applicationIdThe application identifier.
userIdThe user identifier, or null to auto-generate.
deviceIdThe device identifier, or null to auto-generate.
clientIdThe client identifier, or null to auto-generate.
rolesThe roles, if any.
regionThe region, if any.

◆ joinWithChannelId:token:

- (FMLiveSwitchFuture<FMLiveSwitchChannel*>*) joinWithChannelId: (NSString *)  channelId
token: (NSString *)  token 

Joins a channel.

Parameters
channelIdThe channel identifier.
tokenThe auth token.
Returns
A future with the joined channel.

◆ joinWithToken:

- (FMLiveSwitchFuture<FMLiveSwitchChannel*>*) joinWithToken: (NSString *)  token

Joins a channel.

Parameters
tokenThe auth token.
Returns
A future with the joined channel.

◆ leaveWithChannelId:

- (FMLiveSwitchFuture<FMLiveSwitchChannel*>*) leaveWithChannelId: (NSString *)  channelId

Leaves a channel.

Parameters
channelIdThe channel identifier.

◆ messageBytesReceived

- (long long) messageBytesReceived

Gets the number of message bytes received.

◆ messageBytesSent

- (long long) messageBytesSent

Gets the number of message bytes sent.

◆ messagesReceived

- (long long) messagesReceived

Gets the number of messages received.

◆ messagesSent

- (long long) messagesSent

Gets the number of messages sent.

◆ region

- (NSString*) region

Gets the region.

◆ registerWithToken:

- (FMLiveSwitchFuture<NSMutableArray*>*) registerWithToken: (NSString *)  token

Registers with the signalling server.

Parameters
tokenThe auth token.
Returns
A future with an array of initial channels as instructed by the auth token.

◆ removeOnApplicationMessage:

- (void) removeOnApplicationMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Removes a handler that is raised when an application-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ removeOnDeviceMessage:

- (void) removeOnDeviceMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Removes a handler that is raised when a device-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ removeOnHttpRequestCreated:

- (void) removeOnHttpRequestCreated: (FMLiveSwitchAction1< FMLiveSwitchHttpRequestCreatedArgs * > *)  value

Removes a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.

This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ removeOnHttpResponseReceived:

- (void) removeOnHttpResponseReceived: (FMLiveSwitchAction1< FMLiveSwitchHttpResponseReceivedArgs * > *)  value

Removes a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.

This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.

◆ removeOnMessage:

- (void) removeOnMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Removes a handler that is raised when a client-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ removeOnRemoteUpdate:

- (void) removeOnRemoteUpdate: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, FMLiveSwitchClientInfo * > *)  value

Removes a handler that is raised when the the client's config on the server has changed.

◆ removeOnStateChange:

- (void) removeOnStateChange: (FMLiveSwitchAction1< FMLiveSwitchClient * > *)  value

Removes a handler that is raised when the state changes.

◆ removeOnStreamChange:

- (void) removeOnStreamChange: (FMLiveSwitchAction1< id > *)  value

Removes a handler that is raised whenever a client disconnects or reconnects to the internet.

◆ removeOnUserMessage:

- (void) removeOnUserMessage: (FMLiveSwitchAction2< FMLiveSwitchClientInfo *, NSString * > *)  value

Removes a handler that is raised when a user-scope message is received from the server.

Parameters:

  • clientInfo - the sending client information
  • message - the message

◆ requestMaxRetries

- (int) requestMaxRetries

Gets the maximum number of retries allowed for a standard request.

◆ requestTimeout

- (int) requestTimeout

Gets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted.

Defaults to 15000 (15 seconds).

◆ roles

- (NSMutableArray*) roles

Gets the roles.

◆ sendMessage:

- (FMLiveSwitchFuture<id>*) sendMessage: (NSString *)  message

Sends a message to the server with no delivery.

Parameters
messageThe message to be sent.

◆ setDeviceAlias:

- (void) setDeviceAlias: (NSString *)  value

Sets the device alias.

Cannot be set after registration, use the 'Update' method instead.

◆ setDisableWebSockets:

- (void) setDisableWebSockets: (bool)  value

Sets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests.

◆ setExternalId:

- (void) setExternalId: (NSString *)  value

Sets the external client identifier.

◆ setRequestMaxRetries:

- (void) setRequestMaxRetries: (int)  value

Sets the maximum number of retries allowed for a standard request.

◆ setRequestTimeout:

- (void) setRequestTimeout: (int)  value

Sets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted.

Defaults to 15000 (15 seconds).

◆ setTag:

- (void) setTag: (NSString *)  value

Sets the tag.

Cannot be set after registration, use the 'Update' method instead.

◆ setUserAlias:

- (void) setUserAlias: (NSString *)  value

Sets the user alias.

Cannot be set after registration, use the 'Update' method instead.

◆ state

- (FMLiveSwitchClientState) state

Gets the state.

◆ tag

- (NSString*) tag

Gets the tag.

Cannot be set after registration, use the 'Update' method instead.

◆ unregister

- (FMLiveSwitchFuture<id>*) unregister

Unregisters with the signalling server.

Returns
A future that resolves when successfully unregistered.

◆ unregisterException

- (NSException*) unregisterException

Gets the unregister exception, which is set if registration is reset abnormally.

◆ updateWithClientConfig:

- (FMLiveSwitchFuture<id>*) updateWithClientConfig: (FMLiveSwitchClientConfig *)  clientConfig

Updates this client.

Parameters
clientConfigThe client configuration.
Returns
A future that resolves when the client has been updated.

◆ userAlias

- (NSString*) userAlias

Gets the user alias.

Cannot be set after registration, use the 'Update' method instead.

◆ userId

- (NSString*) userId

Gets the user identifier.