use of com.zype.android.webapi.WebApiManager in project zype-android by zype.
the class SettingsProvider method isLogined.
public boolean isLogined() {
// Check if Access Token needs to be refreshed
if (isAccessTokenExpiring() == true) {
WebApiManager webApiManager = WebApiManager.getInstance();
AuthParamsBuilder builder = new AuthParamsBuilder();
builder.addClientId();
builder.addClientSecret();
builder.addRefreshToken(SettingsProvider.getInstance().getRefreshToken());
builder.addGrandType("refresh_token");
webApiManager.executeRequest(WebApiManager.Request.AUTH_REFRESH_ACCESS_TOKEN, builder.build());
}
return !TextUtils.isEmpty(getAccessToken()) && !TextUtils.isEmpty(getRefreshToken()) && !TextUtils.isEmpty(getScope()) && !TextUtils.isEmpty(getTokenType()) && getExpiresIn() != -1L;
}
Aggregations