English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Custom Domain Name

Last Updated on : 2022-08-25 07:07:10

What is Custom Domain Name?

An IoT app and respective smart devices in service initiate network requests to access a certain domain name for data transmission. Currently, the apps developed based on Tuya’s Smart Life App SDK are built with the domain names provided by Tuya.

To configure a custom domain name for your app, you can subscribe to Tuya’s Custom Domain Name service. After a custom domain name is configured and becomes effective, repackage your app and pair smart devices with the app. Then, the network requests initiated by the app and newly-paired devices will be processed through the custom domain name. This helps improve the uniqueness of your app services.

How a custom domain name takes effect

App settings

When you configure a custom domain name, download the domain configuration file and add it to your SDK project. Then, Smart Life App SDK reads information about the custom domain name from this file. The configured custom domain name does not take effect only after you repackage the SDK-based app. If the app is launched before the custom domain name becomes effective, the app still runs with the default domain name.

The custom domain name applies to main APIs of the SDK. However, for H5 pages, specific third-party pages, and URLs configured on your own, or in other special conditions, the domain name might fail to take effect. In this case, you can contact Tuya’s Customer Service team to request technical support.

The Custom Domain Name service supports App SDK v4.0 and later only.

Device settings

Pair associated smart devices again with the app that has a custom domain name newly configured. Otherwise, the custom domain name will not take effect for these smart devices. They will still access the default domain name to transmit data.

Impact on legacy versions

After the custom domain name is configured, your app and respective smart devices in service will not make user-facing changes.

However, if you failed to renew the subscription timely before your custom domain name expires, the domain name will become ineffective. Thus, users cannot access the respective app and smart devices through the domain name as expected.

Validity period and expiration

A custom domain name is valid for one year after it takes effect. After a custom domain name is configured, you can check its validity information at Tuya IoT Development Platform > App > SDK Development > Your target SDK-based app > Custom Domain Name.

The fees for the service subscription and renewal are paid only on an annual basis. You must renew the subscription timely as specified in the rules on the use of custom domain names before your custom domain name expires. Otherwise, the domain name will become ineffective. Thus, users cannot access the respective app and smart devices through the domain name as expected. Therefore, we recommend that you renew the subscription timely before the custom domain name expires to avoid preceding problems.

If you failed to timely renew the subscription, certain problems and responsibilities might be incurred, including but not limited to that the app cannot be used properly, existing paired smart devices cannot be accessed or used, and end users initiate complaints and claims for compensation. In this case, all relevant responsibilities and liabilities will be undertaken by you. Tuya will not take any responsibilities.

Configure a custom domain name

To configure a custom domain name, go to Tuya IoT Development Platform > App > SDK Development > Your target SDK-based app > Custom Domain Name, and click Configure Now.

Custom Domain Name

Continue with the following steps to configure a custom domain name:

Step 1: Read and accept Custom Domain Name Service Agreement

You must first carefully read and accept the Custom Domain Name Service Agreement. The specific content of the agreement is subject to that displayed on the platform.

Custom Domain Name

Step 2: Configure required information

Select a domain name that you prefer. You can enter a keyword for the preferred domain name and choose one from the similar available domain names that appear. Currently, the top-level domain name can only be .net or .com.

Custom Domain Name

Step 3: Wait for the notification of finished configuration

After the settings of the custom domain name are submitted, Tuya’s staff will help you register the specified domain name and finish the required configurations. This process will take three to five working days in most cases. The registration and configuration result will be sent to you by email and SMS. Please wait with patience.

Custom Domain Name

Tuya will help to register your specified domain name. In certain special conditions, the domain name might fail to be registered. Then, Tuya will notify you by email and SMS of the registration failure. You can select another custom domain name and submit the settings again.

Custom Domain Name

Step 4: Renew subscription

After the custom domain name is configured, a domain configuration file for iOS and Android respectively will be generated on the Tuya IoT Development Platform. Download both files, add them to a directory of your SDK project, and then repackage the app to make the domain name effective.

Custom Domain Name

You can check the validity period of the custom domain name on the Custom Domain Name tab and timely renew the subscription if needed.

If you failed to timely renew the subscription, the app and respective smart devices that are accessed through the custom domain name will not be accessed as normal. This will cause a serious impact on your business and your end users’ experience. For more information, see Validity period and expiration.

Tuya will notify you by email or SMS of timely renewal prior to the expiration.

Use domain configuration files

To use the domain configuration files, go to Tuya IoT Development Platform > App > SDK Development > Your target SDK-based app > Custom Domain Name, and download the domain configuration file for the target mobile platform, iOS or Android.

Custom Domain Name

By default, a domain configuration file is named in the format of xxxxx.tcfg. You must rename it as t_cdc.tcfg before you continue with subsequent steps.

Use domain configuration file for iOS

1. Import domain configuration file

As shown in the following figure, rename the downloaded domain configuration file as t_cdc.tcfg, and add it to the root directory of your project: Project Settings > Target > Build Phases > Copy Bundle Resources.

Custom Domain Name

2. Confirm version of Smart Life App SDK

The version of TuyaSmartHomeKit must be v4.0.0 or later.

3. Verify validity of custom domain name

Before this step, the steps in Fast Integration with Smart Life App SDK for iOS must be finished.

You can use this setting [TuyaSmartSDK sharedInstance].debugMode = YES to enable the SDK debug log feature. After the app starts, search for the log entry read custom domain config in the console to check whether data can be read out from the domain configuration file.

If so, disable the SDK debug log feature, repackage the app, and then upload the package to Apple’s App Store to launch the app.

4. FAQs

  • Question 1: Data cannot be read out from the domain configuration file.

    Analytics: After the app starts, the following log entry is printed in the console: Your project does not include a domain configuration file. To use a custom domain name, please go to the Tuya IoT Development Platform and download a domain configuration file. This log entry indicates that data has not been read out from the domain configuration file.

    Solution: Repeat the steps as specified in Import domain configuration file.

  • Question 2: Data can be read out from the domain configuration file, but an error has occurred while parsing the file.

    Analytics: If the error “t_cdc.tcfg file load failed!” has occurred, the following causes might be included:

    1. The domain configuration file and the SDK do not have identical secret information, and thus the system failed to parse the file.
      Solution: We recommend that you verify that the bundle ID and secret information are correct.

    2. The domain configuration file is damaged and cannot be parsed.
      Solution: We recommend that you download the domain configuration file again.

Use domain configuration file for Android

1. Import domain configuration file

As shown in the following figure, rename the downloaded domain configuration file as t_cdc.tcfg, and add it to the assets directory of your project.

Custom Domain Name

2. Confirm version of Smart Life App SDK

The version in implementation 'com.tuya.smart:tuyasmart: xxx must be v4.0.0 or later.

3. Verify validity of custom domain name

Before this step, the steps in Fast Integration with Smart Life App SDK for Android must be finished.

You can use this setting TuyaHomeSdk.setDebugMode(true); to enable the SDK debug log feature. After the app starts, search for the log entry read custom domain config in the console to check whether data can be read out from the domain configuration file.

If so, disable the SDK debug log feature, repackage the app, and then upload the package to the target app store to launch the app.

4. FAQs

  • Question 1: Data cannot be read out from the domain configuration file.

    Analytics: After the app starts, the following log entry is printed in the console: Your project does not include a domain configuration file. To use a custom domain name, please go to the Tuya IoT Development Platform and download a domain configuration file. This log entry indicates that data has not been read out from the domain configuration file.

    Solution: Repeat the steps as specified in Import domain configuration file.

  • Question 2: Data can be read out from the domain configuration file, but an error has occurred while parsing the file.

    Analytics: If the error t_cdc.tcfg file load failed! has occurred while filtering logs using “AssetsConfig”, the following causes might be included:

    1. The domain configuration file and the SDK do not have identical secret information, and thus the system failed to parse the file.
      Solution: We recommend that you verify that the package name, signature file, and secret information are correct.

    2. The domain configuration file is damaged and cannot be parsed.
      Solution: We recommend that you download the domain configuration file again.

Mapping between domain name and data center

After you select a preferred domain name during the configuration, the system automatically generates and configures the second-level domain name or third-level domain name required by different data centers and services. The custom domain name is configured in this format: Service prefix-Data center.Specified custom domain name.

For example, if you select the domain name: customdomain.com, the following custom domain names are generated for the respective data centers:

  • Western America Data Center: Service prefix-us.customdomain.com
  • Central Europe Data Center: Service prefix-eu.customdomain.com
  • India Data Center: Service prefix-in.customdomain.com

A service prefix is an identifier of a specific service and is subject to Tuya’s setting. You can ignore this setting.

Additional notes

  • App domain names targeted at users inside mainland China: If your app users cover those inside mainland China, the app domain name must first go through domain name filing. As a result, custom domain names are currently not supported. In this case, your app runs with the domain name provided by Tuya.
  • The Tuya IoT Development Platform currently does not support your existing domain name. If you have any questions, please contact Tuya’s Customer Service team.
  • The configured custom domain name applies to network requests initiated by your app and paired devices, respecting the main pages, features, and services. However, for the pages outside the app, historical features, specific third-party pages, and URLs configured on your own, or in other special conditions, the domain name might fail to take effect. In this case, you can contact Tuya’s Customer Service team to request technical support.