use of retrofit.ResponseCallback in project connect-android-sdk by telenordigital.
the class ConnectIdService method callLogOutApiEndpoint.
private void callLogOutApiEndpoint(final String accessToken, final ConnectCallback callback) {
String auth = "Bearer " + accessToken;
connectApi.logOut(auth, new ResponseCallback() {
@Override
public void success(Response response) {
callback.onSuccess(null);
}
@Override
public void failure(RetrofitError error) {
Log.e(ConnectUtils.LOG_TAG, "Failed to call logout with access token on API. accessToken=" + accessToken, error);
callback.onError(error);
}
});
}
use of retrofit.ResponseCallback in project connect-android-sdk by telenordigital.
the class ConnectSdk method sendAnalyticsData.
private static void sendAnalyticsData() {
if (getWellKnownConfig().getAnalyticsEndpoint() == null) {
return;
}
String accessToken = getAccessToken();
final String auth = accessToken != null ? "Bearer " + accessToken : null;
final String subject = getIdToken() != null ? getIdToken().getSubject() : null;
RestHelper.getAnalyticsApi(getWellKnownConfig().getAnalyticsEndpoint()).sendAnalyticsData(auth, new AnalyticsAPI.SDKAnalyticsData(getApplicationName(), getApplicationVersion(), subject, getLogSessionId(), getAdvertisingId(), tsSdkInitiliazation, tsLoginButtonClicked, tsRedirectUrlInvoked, tsTokenResponseReceived), new ResponseCallback() {
@Override
public void success(Response response) {
}
@Override
public void failure(RetrofitError error) {
Log.e(ConnectUtils.LOG_TAG, "Failed to send analytics data", error);
}
});
}
Aggregations