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

1.1. Handling of Expired Session

If you have not logged in to your account for a long time, the session expiration error will be returned when you access the server interface. You have to monitor the notification of thesetOnNeedLoginListener and log in to the account again after the login page is displayed.


TuyaHomeSdk.setOnNeedLoginListener(INeedLoginListener needLoginListener);


TuyaHomeSdk.setOnNeedLoginListener(new INeedLoginListener() {
  public void onNeedLogin(Context context) {



  • Once such a callback occurs, please go to the login page and let the user log in again.
  • Recommended for use in Application

results matching ""

    No results matching ""