This document is deprecated, please go to Tuya Developer Documentation Center to view the latest version: Tuya Smart Doc - Android SDK

1. Account Binding

1.1. Bind With Email

There are two interfaces for mailbox binding, first get the verification code, and then use the verification code to bind the mailbox

Declaration

Get the verification code of the bound email

void sendBindVerifyCodeWithEmail(@NonNull String countryCode, @NonNull String email, @NonNull IResultCallback callback);

Parameters

Param Description
countryCode Country code, for example: 86
email email
callback Callback

Declaration

Bind Email

void bindEmail(@NonNull String countryCode, @NonNull String email, @NonNull String code, @NonNull String sId, @NonNull IResultCallback callback);

Parameters

Param Description
countryCode Country code, for example: 86
email email
code Verification Code
sId User sessionId
callback Callback

Example

        TuyaHomeSdk.getUserInstance().sendBindVerifyCodeWithEmail("86","123456@123.com", new IResultCallback(){

            @Override
            public void onError(String code, String error) {

            }

            @Override
            public void onSuccess() {
                Toast.makeText(mContext, "sendBindVerifyCodeWithEmail success", Toast.LENGTH_SHORT).show();
            }
        });

        TuyaHomeSdk.getUserInstance().bindEmail("86", "123456@123.com","123456", TuyaHomeSdk.getUserInstance().getUser().getSid(), new IResultCallback() {
            @Override
            public void onError(String code, String error) {
                Toast.makeText(mContext, "bind fail", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onSuccess() {
                Toast.makeText(mContext, "bind success", Toast.LENGTH_SHORT).show();
            }
        });

results matching ""

    No results matching ""