Last Updated on : 2023-12-07 03:15:42download
For more information, see Login-free token of Cloud Development.
Description
The user obtains the ticket field through the third-party interface and calls the interface to obtain user information.
TuyaHomeSdk.getUserInstance().loginWithTicket(String ticket, ILoginCallback callback);
Parameters
Parameter | Description |
---|---|
ticket | Third-party APP uses “ticket” to log in to Tuya SDK |
Example
//ticket login
TuyaHomeSdk.getUserInstance().loginWithTicket("ticket", new ILoginCallback() {
@Override
public void onSuccess(User user) {
Toast.makeText(mContext, "Successfully logged in:" , Toast.LENGTH_SHORT).show();
}
@Override
public void onError(String code, String error) {
Toast.makeText(mContext, "code: " + code + "error:" + error, Toast.LENGTH_SHORT).show();
}
});
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback