TcrSdkInstance Class Reference

Inherits from NSObject
Declared in TcrSdkInstance.h
TcrSdkInstance.m

– setTcrConfig:error:

Set the AccessInfo and Token to TcrSdk

- (void)setTcrConfig:(TcrConfig *)tcrConfig error:(NSError **)error

Parameters

tcrConfig

Session configuration information, which is obtained by the business backend calling the cloud API CreateAndroidInstancesAccessToken.

Discussion

Set the AccessInfo and Token to TcrSdk

Declared In

TcrSdkInstance.h

– createSessionWithParams:

Creates a new TcrSession instance.

- (TcrSession *)createSessionWithParams:(NSDictionary *)params

Parameters

params

Dictionary containing TcrSession configuration parameters.
Optional, the following key-value pairs can be selected: - @“preferredCodec”: Optional values are @“H264”, @“H265”, @“VP8”, and @“VP9”. Used to set the preferred codec. If this field is set, the session will try to use the preferred codec for communication. If the preferred codec is not available, other available codecs will be used. If this field is not set or the setting is invalid, the session will use the default codec.

  • @“preferredCodecList”: The value is an NSArray, which contains the optional values @“H264”, @“H265”, @“VP8”, and @“VP9”. Indicate preferred codecs, where the order of the elements in the list represents priority, such as index 0 being the highest priority preferred codec. If the set codecs cannot be selected for various reasons, other available codecs will be chosen.

  • @“idleThreshold”: The idle detection threshold, that is, the duration of user inactivity. The unit is Millisecond. When this threshold is reached, the event TcrEvent.CLIENT_IDLE will be triggered.

  • @“local_video”: Optional value is of bool type. Used to enable the local camera.

  • @“local_audio”: Optional value is of bool type. Used to enable the local microphone.

  • @“enableCustomAudioCapture”:@{@“sampleRate”:NSInteger, @“useStereoInput”: BOOL}, enable custom audio capture and bring the sample rate and channel count of the custom captured audio (both parameters are required). e.g. @“enableCustomAudioCapture”:@{@“sampleRate”:@(48000), @“useStereoInput”:@(false)} means a sample rate of 48000 and mono data. In addition, to enable custom audio capture, you also need to set @“local_audio” to enable local audio upstream.

  • @“remoteDesktopResolution”:@{@“width”:NSInteger , @“height”:NSInteger} ,Set the resolution of Cloud Desktop. If the cloud PC application is in full-screen mode, the resolution of the downstream video stream will also change accordingly. NOTE:This param is only for PC application, and the mobile application is not supported.

Return Value

Newly created TcrSession instance, nil if creation fails.

Discussion

Initializes and returns a new TcrSession object with the specified parameters. Returns a non-nil pointer on success, nil on failure. The caller is responsible for managing the returned session’s lifecycle (automatically handled under ARC).

Declared In

TcrSdkInstance.h

– destroySession:

Destroys a session object.

- (void)destroySession:(TcrSession *)session

Parameters

session

Session object to destroy.

Declared In

TcrSdkInstance.h

– getAndroidInstance

Retrieves the AndroidInstance operator object.

- (AndroidInstance *)getAndroidInstance

Return Value

AndroidInstance operator object, nil if uninitialized.

Discussion

Returns the operator instance for interacting with cloud Android devices. Returns nil if the SDK client hasn’t been properly initialized.

Declared In

TcrSdkInstance.h

– updateToken:

Updates access tokens for all instances.

- (void)updateToken:(NSString *)token

Parameters

token

New access token string.

Discussion

Bulk updates access tokens for all created instances. This operation takes immediate effect, and all subsequent requests will use the new token for authentication.

Declared In

TcrSdkInstance.h