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

Feedback

Last Updated on : 2022-10-31 12:19:42download

The feedback methods mentioned in this topic will be deprecated. We recommend that you integrate FAQ UI BizBundle. After the integration, feedback history can be checked on your app and at Tuya IoT Development Platform > Operation > User Feedback.

All feedback features of Tuya Smart Life App SDK are implemented by the classes ITuyaFeedbackManager and ITuyaFeedbackMsg. For example, query a list of feedback sessions, query a list of feedback content, query a list of feedback types, and add a feedback session.

Class name Description
ITuyaFeedbackManager Feedback management class
ITuyaFeedbackMsg Feedback management class for a specific session

Description

Users can give feedback on the app through the following process if needed:

  • Add feedback: Users can select a feedback type, provide feedback content, and then submit the feedback.
  • Generate feedback: After the feedback is received, the system generates a feedback session based on the specified feedback type.
  • Process feedback: Users can continue to provide and submit feedback content in the same feedback session. The feedback content appears in the feedback list of the session.

Query a list of feedback sessions

Returns a list of sessions for the feedback submitted by users.

API description

void getFeedbackManager().getFeedbackList(final ITuyaDataCallback<List<FeedbackBean>> callback);

Parameters

Parameter Description
callback The success or failure callback. null cannot be returned.

Data model of FeedbackBean

Field Type Description
dateTime String The date and time.
content String The feedback content.
hdId String The feedback category ID.
hdType String The feedback type.
title String The category title. It is a device name for the device failure feedback.

Example

TuyaHomeSdk.getTuyaFeekback().getFeedbackManager().getFeedbackList(new ITuyaDataCallback<List<FeedbackBean>>() {
    @Override
    public void onSuccess(List<FeedbackBean> feedbackTalkBeans) {}
    @Override
    public void onError(String errorCode, String errorMessage) {}
});

Query a list of feedback content

Returns a list of feedback content submitted by users. You can call FeedbackBean to get the hdId and hdType field values.

Declaration

void getFeedbackMsg(hdId, hdType).getFeedbackList(final ITuyaDataCallback<List<FeedbackMsgBean>> callback);

Parameters

Parameters Description
hdId The feedback ID.
hdType The feedback type.
callback The success or failure callback. null cannot be returned.

FeedbackMsgBean data model

field type description
id int The feedback content ID.
cTime int The feedback timestamp. Unit: seconds.
content String The feedback content.
hdId String The feedback ID.
hdType int The feedback type.

Example

TuyaHomeSdk.getTuyaFeekback().getFeedbackMsg(hdId, hdType).getMsgList(new ITuyaDataCallback<List<FeedbackMsgBean>>() {
    @Override
    public void onSuccess(List<FeedbackMsgBean> result) {}
    @Override 
    public void onError(String errorCode, String errorMessage) {}
});

Query a list of feedback types

Returns a list of feedback types that can be selected when users give feedback.

API description

void getFeedbackType(final ITuyaDataCallback<List<FeedbackTypeRespBean>> callback);

Parameters

Parameter Description
callback The success or failure callback. null cannot be returned.

Data model of FeedbackTypeRespBean

Field Type Description
list List The list of feedback types.
type String The type of list. Currently, only the device and other types are supported.

Data model of FeedbackTypeBean

Field Type Description
hdId String The feedback category ID.
hdType String The feedback type.
title String The category title. It is a device name for the device failure feedback.

Example

TuyaHomeSdk.getTuyaFeekback().getFeedbackManager().getFeedbackType(new ITuyaDataCallback<List<FeedbackTypeRespBean>>() {
    @Override
    public void onSuccess(List<FeedbackTypeRespBean> feedbackTypeRespBeans) {}
    @Override
    public void onError(String errorCode, String errorMsg) {}
});

Add feedback

Adds a feedback session and submits feedback contents entered by users.

API description

void addFeedback(final String message,String contact, String hdId, int hdType, final ITuyaDataCallback<FeedbackMsgBean> callback);

Parameters

Parameter Description
message The feedback content.
contact The mobile phone number or email address.
hdId The feedback category ID.
hdType The feedback type.
callback The success or failure callback. null cannot be returned.

Example

TuyaHomeSdk.getTuyaFeekback().getFeedbackManager().addFeedback(
    "The device has faults.",
    "abc@qq.com",
    feebackTypeBean.getHdId(),
    feebackTypeBean.getHdType(),
    new ITuyaDataCallback<FeedbackMsgBean>() {
        @Override
        public void onSuccess(FeedbackMsgBean feedbackMsgBean) {}
        @Override
        public void onError(String errorCode, String errorMsg) {}
});