Qiscus Chat SDK (core) v1.8.0
Changelog :
- Update flow expired token
for example for handle new flow
//Subscribe to AllActivity
@Subscribe
public void onRefreshToken(QiscusRefreshTokenEvent event) {
if (event.isTokenExpired()) {
//need to call api refresh token when auto refresh token from be is false, by default is true from be
callRefreshToken();
} else if (event.isUnauthorized()) {
//need to force re login or re init qiscusCore
reLoginUser();
}
}
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()) {
QiscusCore.clearUser();
}
//call flow re initiate SDK qiscusCore
}