Search in sources :

Example 1 with ResponseCallback

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);
        }
    });
}
Also used : Response(retrofit.client.Response) ResponseCallback(retrofit.ResponseCallback) RetrofitError(retrofit.RetrofitError)

Example 2 with ResponseCallback

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);
        }
    });
}
Also used : Response(retrofit.client.Response) ResponseCallback(retrofit.ResponseCallback) RetrofitError(retrofit.RetrofitError)

Aggregations

ResponseCallback (retrofit.ResponseCallback)2 RetrofitError (retrofit.RetrofitError)2 Response (retrofit.client.Response)2