In-App Chat SDK Android Version 1.6.0 Release

  • Updated

Announce: October 25, 2022

 

Hi there, Good news! We have made some improvements in chat SDK Android. Below is the list of changes:

  • New Flow expired token

Implementation: call API refresh token if the auto-refresh token is false from BE (by default is true), please contact us to set auto-refresh to be false.

For the implementation of manually calling the API refresh token, you can use this code.

@Subscribe
    public void onRefreshToken(QiscusRefreshTokenEvent event) {
        if (event.isTokenExpired()) {
             if auto refresh token false from be, you need to call api refresh token manually
            //callRefreshToken();
        } else if (event.isUnauthorized()) {
            //need to force logout
            logoutUser();
        } else {
            // do somethings
        }
    }
    
 private void callRefreshToken() {
        QiscusCore.refreshToken(new QiscusCore.SetRefreshTokenListener() {
            @Override
            public void onSuccess(QiscusRefreshToken refreshToken) {
            
            }

            @Override
            public void onError(Throwable throwable) {
            
            }
        });
    }

    private void logoutUser() {
        if (QiscusCore.hasSetupUser()) {
            Qiscus.clearUser();
        }
    }

Note: Please contact us if you want to implement the flow expired token and manually or automatically call the API refresh token.

For further information, feedback, or questions about the changes above, please feel free to drop us some feedback at https://support.qiscus.com/.

Best regards,
Product Team

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.