Last Updated on : 2023-03-29 01:15:18download
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, rebuild 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.
An IoT app and respective smart devices in service initiate network requests to access a certain domain name for data transmission. Tuya supports two types of domain name services:
Default domain name service: Without any configurations, the apps developed based on Tuya’s App SDK services are built with the domain names provided by Tuya.
Custom Domain Name: Based on the Custom Domain Name service, network requests will be forwarded to a domain name customized to your needs. This topic describes how to configure a custom domain name.
Minimum version: Custom Domain Name only applies to apps developed based on Smart Life App SDK v4.0 or later.
Special conditions: The custom domain name applies to main pages and features of the app. However, for H5 pages, specific third-party pages, and URLs configured on your own, or in other special conditions, the custom domain name might fail to take effect. In this case, you can submit a ticket to request technical support.
Online applications: 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.
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.
A custom domain name is valid for one year after it takes effect. If the subscription expires, the domain name will be ineffective. Thus, users cannot access the respective app and smart devices through the domain name as expected.
You must renew the subscription timely before the custom domain name expires. Otherwise, certain problems and responsibilities might be incurred, including but not limited to that the app is disabled, existing paired smart devices cannot be accessed or used, and end users initiate complaints and claims for compensation. In this case, if you fail to renew the subscription, all relevant responsibilities and liabilities will be undertaken by you. For more information about the period of validity, see Step 6: Check validity and renew subscription.
Log in to the Tuya IoT Development Platform.
In the left-side navigation pane, go to App > App SDK > SDK Development.
Click the target SDK-based app.
Select the Custom Domain Name tab and click Configure Now to configure a custom domain name.
Carefully read and accept the Custom Domain Name Service Agreement. The specific content of the agreement is subject to that displayed on the platform.
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
.
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.
During the registration and configuration, 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.
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 and add them to a directory of your SDK project.
Log in to the Tuya IoT Development Platform.
In the left-side navigation pane, go to App > App SDK > SDK Development.
Click the target SDK-based app.
Select the Custom Domain Name tab, and download the domain configuration file for the target mobile platform, iOS or Android.
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.
Import the domain configuration file.
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.
Confirm the version of Smart Life App SDK.
The version of TuyaSmartHomeKit
must be v4.0.0 or later.
Verify the validity of the custom domain name.
Before this step, the steps in Fast Integration with Smart Life App SDK 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.
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 the domain configuration file is not found.
Solution: Repeat the steps as specified in Use domain configuration file for iOS.
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.
Possible cause | Solution |
---|---|
The domain configuration file and the SDK do not have identical secret information, and thus the system failed to parse the file. | We recommend that you verify that the bundle ID and secret information are correct. |
The domain configuration file is damaged and cannot be parsed. | We recommend that you download the domain configuration file again. |
The version of TuyaSmartNetworkKit is legacy. Make sure this version in Podfile.lock is v4.0.2 or later . |
Run the command pod update TuyaSmartNetworkKit to update this component. |
Import the domain configuration file.
Rename the downloaded domain configuration file as t_cdc.tcfg
, and add it to the assets
directory of your project.
Confirm the version of Smart Life App SDK.
The version in implementation 'com.tuya.smart:tuyasmart: xxx
must be v4.0.0 or later.
Verify the validity of the custom domain name.
Before this step, the steps in Fast Integration with Smart Life App SDK 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.
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 the domain configuration file is not found.
Solution: Repeat the steps as specified in Use domain configuration file for Android.
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.
Possible cause | Solution |
---|---|
The domain configuration file and the SDK do not have identical secret information, and thus the system failed to parse the file. | We recommend that you verify that the package name, signature file, and secret information are correct. |
The domain configuration file is damaged and cannot be parsed. | We recommend that you download the domain configuration file again. |
After the configurations are finished, repackage the app to make the custom domain name take effect.
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 renew the subscription timely before the service expires, 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 Period of validity.
Tuya will notify you by email or SMS of timely renewal prior to the expiration.
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:
Service prefix-us.customdomain.com
Service prefix-eu.customdomain.com
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.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback