Last Updated on : 2024-06-05 03:14:36download
This topic describes common operations on a mobile phone.
Note: Version 4.0 and later are supported.
TYSdk.mobile.back()
Return to the app list from the panel container.
/**
* @desc Return the app list from the panel container.
*/
TYSdk.mobile.back();
TYSdk.mobile.bottomListDialog()
Display the bottom dialog list.
Name | Data type | Description | Required |
---|---|---|---|
itemList | string[] |
The list | Yes |
selected | string |
One item in the list | Yes |
onConfirmed | () => void |
Confirm the function | Yes |
/**
* @desc Display bottom dialog list
*/
TYSdk.mobile.bottomListDialog(itemList, selected, onConfirmed);
TYSdk.mobile.disablePopGesture()
Disable the fullscreen pop gesture.
/**
* @desc Disable the fullscreen pop gesture in iOS
*/
TYSdk.mobile.disablePopGesture();
TYSdk.mobile.enablePopGesture()
Enable the fullscreen pop gesture.
/**
* @desc ios Enable the fullscreen pop gesture
*/
TYSdk.mobile.enablePopGesture();
TYSdk.mobile.getMobileInfo()
Get user information.
Name | Data type | Description |
---|---|---|
MobileInfo | MobileInfo | Get user information |
/**
* @desc Get user information including app version information and time zone information
*/
TYSdk.mobile.getMobileInfo();
TYSdk.mobile.getNetworkState()
Get user information.
Name | Data type | Description |
---|---|---|
netWorkState | `‘WIFI’ | ‘GPRS’ |
TYSdk.mobile.getNetworkState();
TYSdk.mobile.hideLoading()
Hide the native loading UI box of the app.
/**
* @desc Hide the native loading UI box of the app
*/
TYSdk.mobile.hideLoading();
TYSdk.mobile.is24Hour()
Check whether the 24-hour system is enabled for the device.
Name | Data type | Description |
---|---|---|
is24Hour | Promise<boolean> |
Indicate whether ithe 24-hour system is used |
TYSdk.mobile.is24Hour()
.then(data => {
console.log('data :>> ', data);
})
.catch(error => {
console.log('error :>> ', error);
});
TYSdk.mobile.jumpSubPage()
Jump to the secondary page according to uiId.
Name | Data type | Description | Required |
---|---|---|---|
uiIdParams | { uiId: string } |
The value of uiId for the secondary page |
Yes |
pageParams | object |
The required attributes | Yes |
/**
* @desc Jump to the secondary page by `uiId`
*/
TYSdk.mobile.jumpSubPage(uiIdParams: { uiId }, pageParams);
TYSdk.mobile.jumpTo()
Jump to an existing scene in which mounting is not canceled. It can jump to a webpage.
Name | Data type | Description | Required |
---|---|---|---|
url | string |
Set the web URL jumping function to jump to the mall and official website. If the short URL has been configured with parameters, you need to add parameters, such as ${url}?homeId=123456 |
Yes |
/**
* @desc Jump to an existing scene in which mounting is not canceled. It can jump to a webpage
*/
TYSdk.mobile.jumpTo(url);
Note: The jumping of all the following modules must be added with
tuyasmart://
prefix, such as TYSdk.mobile.jumpTo(‘tuyasmart://createScene_allDevices’).
Module | URL | **Name** | Notes |
---|---|---|---|
Scene module | sceneAction | {"action":"sceneUiUpdate"} | Common scene actions, such as refreshing the UI |
createScene | {"devid":"Device Id"} | Common creation scene | |
createScene_allDevices | None | Create all device types by using the Zigbee scene switch | |
editScene | {"sceneId":"Scene Id"} | Common edition scene | |
createAuto | {"devId":"device Id","dpId":"DP Id","dpValue":"DP Value","actionDisplay":"action display name","actionExcutor":"action type"} | The sound and light alarm panel is triggered to create automation actions | |
createAutoWithCondition | {"devId":"device Id","dpId":"DP Id","dpValue":"DP Value","operator":"operator","exprDisplay":"expression display name", "entityType":"condition type","extraInfo":" extra condition information"} | Create automation actions with specific conditions | |
Family module | tysh_house_manage | None | Family management page |
tysh_room_manage | { "homeId":"room ID" } | Room management page | |
tysh_family_add | None | Add a family page | |
tysh_family_setting | { "homeId":"room ID" } | Set a family page | |
tysh_room_setting | { "homeId":"room ID" } | Set a room page | |
tysh_family_add_member | { "homeId":"room ID" } | Add a family member page | |
tysh_family_associate_member_rn | {"memberId":"Member ID","isAdmin":"Whether it is the administrator "} | Jump to the associated member page | |
member_info | {"memberId":"memberId","role":"roleType","homeId":"homeId"} | Family member information | |
User center | about | None | About us |
user | None | The user information page | |
ty_user_center | None | The user center page | |
ty_user_setting | None | Setting page | |
browser | { "url":"FAQ webpage URL" } | FAQ | |
settingMoreService | None | Jump to more services | |
ty_mobile_bind | None | Bind the mobile phone number | |
Login module | registernew | None | Register a new account |
tp_login | None | The login page | |
ty_auth_code_login | {"countryCode":"Country code","account":"Account"} | Verification code page for login | |
modifyPassword | None | Change the password in the login status | |
ty_forget_password | {"countryCode":"Country code","account":"Account"} | Forget password | |
ty_signout | None | Log out | |
ty_anonymous_mode | None | Jump to experience mode | |
Network configuration module | presentGatewayCategroy | {"gwId":"gateway ID"} | Zigbee gateway panel v1.0 is paired with a sub-device router |
device_only_search_config_gw_sub | {"gwId":"gateway ID"} | Start searching for the pairing router | |
device_gw_sub_device_help_list | {"gwId":"gateway ID"} | List all the routers according to the sub-device types | |
Homepage module | ty_family_speech | None | Short URL of the voice assistant desktop shortcut |
Feedback module | ty_feedback | { "key" : "Feedback key" } | Enter information on the feedback page |
helpAndFeedBack | None | Feedback list page | |
Message center | messageCenter | None | Message center page |
TYSdk.mobile.mobileInfo
Get user information.
Name | Data type | Description |
---|---|---|
MobileInfo | MobileInfo | Get user information |
console.log(TYSdk.mobile.mobileInfo);
TYSdk.mobile.showEditDialog()
Edit dialog box.
Name | Data type | Description | Required |
---|---|---|---|
title | string |
Title | Yes |
editString | string |
Edit message content | Yes |
onConfirmed | () => void |
Confirm the function | Yes |
onCanceled | () => void |
Cancel the function | Yes |
/**
* @desc Edit the dialog box
*/
TYSdk.mobile.showEditDialog(title, editString, onConfirmed, onCanceled);
TYSdk.mobile.showLoading()
Display the native loading UI box of the app.
/**
* @desc Display the native loading UI box of the app.
*/
TYSdk.mobile.showLoading();
TYSdk.mobile.showPromptDialog()
Lightweight dialogs.
Name | Data type | Description | Required |
---|---|---|---|
confirmText | string |
Confirm text | Yes |
cancelText | string |
Cancel text | Yes |
title | string |
Dialog box title | Yes |
message | string |
Text | Yes |
defaultValue | string |
Default value | Yes |
onConfirmed | () => void |
Confirm the function | Yes |
onCanceled | () => void |
Cancel the function | Yes |
/**
* @desc The lightweight dialog box
*/
TYSdk.mobile.showPromptDialog(
confirmText,
cancelText,
title,
message,
defaultValue,
onConfirmed,
onCanceled
);
TYSdk.mobile.simpleConfirmDialog()
A simple confirmation dialog box.
Name | Data type | Description | Required |
---|---|---|---|
title | string |
Title | Yes |
msg | string |
Dialog box information | Yes |
onConfirmed | () => void |
Confirm the function | Yes |
onCanceled | () => void |
Cancel the function | Yes |
/**
* @desc Simple confirmation dialog box
*/
TYSdk.mobile.simpleConfirmDialog(title, msg, onConfirmed, onCanceled);
TYSdk.mobile.simpleTipDialog()
A simple prompt box.
Name | Data type | Description | Required |
---|---|---|---|
msg | string |
Dialog box information | Yes |
onConfirmed | () => void |
Confirm the function | Yes |
/**
* @desc A simple prompt box
*/
TYSdk.mobile.simpleTipDialog(msg, onConfirmed);
TYSdk.mobile.verSupported()
Check whether the app version is supported.
Name | Data type | Description |
---|---|---|
verSupported | boolean |
Indicate whether the app version is supported |
TYSdk.mobile.verSupported();
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback