Native API

Last Updated on : 2022-02-16 09:54:42download

TYRCTCameraManager

The following methods are described.

connect

JS -> Native, the React Native (RN) panel calls native APIs.

Creates a P2P connection.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

disconnect

JS -> Native, the RN panel calls native APIs.

Closes a P2P connection.

Starting version Applicable platform
1.0.0 All

getStatusBarHeight

JS -> Native, the RN panel calls native APIs.

Returns the height of a status bar and only applies to Android.

Starting version Applicable platform
1.0.0 Android
No. Parameter Type Description
1 success SuccessCb The success callback.

alarm

JS -> Native, the RN panel calls native APIs.

Opens an alert page.

Starting version Applicable platform
1.0.0 All

updateName

JS -> Native, the RN panel calls native APIs.

Updates a device name.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 name String The name of a device.
2 success SuccessCb The success callback.
3 failure FailureCb The failure callback.

isConnected

JS -> Native, the RN panel calls native APIs.

Indicates whether a connection is created.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

isConnecting

JS -> Native, the RN panel calls native APIs.

Indicates whether a P2P connection is being created.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

setScreenOrientation

JS -> Native, the RN panel calls native APIs.

Switches between screen orientations.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 orientation Integer The screen orientation. Valid values: 0 means a portrait screen and 1 means a landscape screen.

photos

JS -> Native, the RN panel calls native APIs.

The panel for iOS navigates to a system album and the panel for Android navigates to a generic album.

Starting version Applicable platform
1.0.0 Android

gotoPhotoLibrary

JS -> Native, the RN panel calls native APIs.

The panel (app 3.15 or later) for iOS navigates to a generic album.

Starting version Applicable platform
1.0.0 iOS

gotoCameraPanelMore

JS -> Native, the RN panel calls native APIs.

Navigates to the device settings page.

Starting version Applicable platform
1.0.0 All

gotoMultiCameraPanel

JS -> Native, the RN panel calls native APIs.

Navigates to the multi-screen preview page (app 3.15 or later).

Starting version Applicable platform
1.0.0 All

gotoCameraNewPlaybackPanel

JS -> Native, the RN panel calls native APIs.

Navigates to the playback page (app 3.15 or later).

Starting version Applicable platform
1.0.0 All

gotoCloudStoragePanel

JS -> Native, the RN panel calls native APIs.

Navigates to the cloud storage page (app 3.15 or later).

Starting version Applicable platform
1.0.0 All

gotoCameraMessageCenterPanel

JS -> Native, the RN panel calls native APIs.

Navigates to the IPC message center page (app 3.15 or later).

Starting version Applicable platform
1.0.0 All

obtainWifiSignal

JS -> Native, the RN panel calls native APIs.

Returns the Wi-Fi signal strength for a smart device. In the success callback, a percentage value is returned as the parameter. For example, a value of 80 indicates a 80% signal strength.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

startPtzUp

JS -> Native, the RN panel calls native APIs.

Controls an IPC to rotate upward.

Starting version Applicable platform
1.0.0 All

startPtzDown

JS -> Native, the RN panel calls native APIs.

Controls an IPC to rotate downward.

Starting version Applicable platform
1.0.0 All

startPtzLeft

JS -> Native, the RN panel calls native APIs.

Controls an IPC to rotate leftward.

Starting version Applicable platform
1.0.0 All

startPtzRight

JS -> Native, the RN panel calls native APIs.

Controls an IPC to rotate rightward.

Starting version Applicable platform
1.0.0 All

stopPtz

JS -> Native, the RN panel calls native APIs.

Controls an IPC to stop rotation.

Starting version Applicable platform
1.0.0 All

startPreviewWithDefinition

JS -> Native, the RN panel calls native APIs.

TuyaSmartCameraDefinitionProflow = 0x1,      `1`: saved streams

TuyaSmartCameraDefinitionStandard = 0x2,    `2`: SD

TuyaSmartCameraDefinitionHigh = 0x4,        `4`: HD

TuyaSmartCameraDefinitionSuper = 0x8,      `8`: ultra HD

TuyaSmartCameraDefinitionSSuper = 0x10,    `10`: super ultra HD
Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 definition Integer The video definition.
2 success SuccessCb The success callback.
3 failure FailureCb The failure callback.

stopPreview

JS -> Native, the RN panel calls native APIs.

Stops previewing.

Starting version Applicable platform
1.0.0 All

isRecording

JS -> Native, the RN panel calls native APIs.

Indicates whether the device is recording videos during live streaming and playback.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

startRecord

JS -> Native, the RN panel calls native APIs (the panel for iOS saves recorded video footage to a system album).

Starts recording during live streaming and playback (startRecordToAlbum is called for app 3.15 or later).

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

startRecordToAlbum

JS -> Native, the RN panel calls native APIs (the panel for iOS saves recorded video footage to a generic album).

Starts recording during live streaming and playback (app 3.15 or later).

Starting version Applicable platform
1.0.0 iOS
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

stopRecord

JS -> Native, the RN panel calls native APIs.

Stops recording during live streaming and playback.

Starting version Applicable platform
1.0.0 stopRecord
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

snapShootToAlbum

JS -> Native, the RN panel calls native APIs.

Captures screenshots during live streaming and playback. The panel (app 3.15 or later) for iOS saves screenshots to a generic album.

Starting version Applicable platform
1.0.0 iOS
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

isPreviewOn

JS -> Native, the RN panel calls native APIs.

Indicates whether the preview operation is successful.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

enableMute

JS -> Native, the RN panel calls native APIs.

Enables the mute mode during live streaming and playback.

Starting version Applicable platform
1.0.0 iOS
No. Parameter Type Description
1 mute Boolean Enables the mute mode.
2 success SuccessCb The success callback.
3 failure FailureCb The failure callback.

isMuting

JS -> Native, the RN panel calls native APIs.

Indicates whether the mute mode is enabled during live streaming and playback.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

enableHd

JS -> Native, the RN panel calls native APIs.

Enables the HD mode.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 hd Boolean Enables the HD mode.
2 success SuccessCb The success callback.
3 failure FailureCb The failure callback.

isHDOn

JS -> Native, the RN panel calls native APIs.

Indicates whether the HD video quality is enabled.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

getCurViewHeight

JS -> Native, the RN panel calls native APIs.

Returns the height of the current video resolution.

Starting version Applicable platform
1.0.0 iOS
No. Parameter Type Description
1 success SuccessCb The success callback.

getCurViewWidth

JS -> Native, the RN panel calls native APIs.

Returns the width of the current video resolution.

Starting version Applicable platform
1.0.0 iOS
No. Parameter Type Description
1 success SuccessCb The success callback.

startTalk

JS -> Native, the RN panel calls native APIs.

Enables the video talk

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

stopTalk

JS -> Native, the RN panel calls native APIs.

Disables the video talk.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

isTalkBacking

JS -> Native, the RN panel calls native APIs.

Indicates whether the device is processing video talk.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

isRecording

JS -> Native, the RN panel calls native APIs.

Indicates whether the device is recording videos during live streaming and playback.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

isSupportedTalk

JS -> Native, the RN panel calls native APIs.

Indicates whether the device supports video talk. When the IPC panel is initially opened, this API method must be called after a P2P connection is created. In later calls, the cached value will be used.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

isSupportedSound

JS -> Native, the RN panel calls native APIs.

Indicates whether a device supports a pickup. When the IPC panel is initially opened, this API method must be called after a P2P connection is created. In later calls, the cached value will be used for app 3.15 or later.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

isSupportedCloudStorage

JS -> Native, the RN panel calls native APIs.

Indicates whether a device supports cloud storage.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

supportedAudioMode

JS -> Native, the RN panel calls native APIs.

The video talk mode supported by the device. The Value type of parameter is returned in the callback. Valid values: 0means an unknown mode,1means a one-way video talk, and2 means a two-way video talk.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

wakeUpDoorBell

JS -> Native, the RN panel calls native APIs.

Wakes up a doorbell. For a sleep doorbell, this API method must be called before a P2P connection is created.

Starting version Applicable platform
1.0.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.

openFloatWindowWithCallback

JS -> Native, the RN panel calls native APIs.

Opens a floating window to play videos. For non-IPC devices, after the requested result is returned, an API request must be made to close the panel.

Starting version Applicable platform
3.36.0 All
No. Parameter Type Description
1 success SuccessCb The success callback.
2 failure FailureCb The failure callback.

openFloatWindow

JS -> Native, the RN panel calls native APIs.

Opens a floating window to play videos. This API method is available for IPCs.

Starting version Applicable platform
3.35.5 All