Handling of Expired Session

Last Updated on : 2023-12-07 03:15:42download

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.

Declaration

TuyaHomeSdk.setOnNeedLoginListener(INeedLoginListener needLoginListener);

Example

TuyaHomeSdk.setOnNeedLoginListener(new INeedLoginListener() { @Override public void onNeedLogin(Context context) { } });

Notes:

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