1

I want to pass the sessionid as the header while downloading the image in fresco. I tried this code

val okHttpClient = OkHttpClient.Builder().addInterceptor{chain ->
          chain.proceed(chain.request().newBuilder().addHeader("YourHeader", "value").build());
    }.build();

Fresco.initialize(mContext, OkHttpImagePipelineConfigFactory.newBuilder(mContext, okHttpClient).build());

but this doesn't help as I will not have the session while initializing the fresco

ADM
  • 20,406
  • 11
  • 52
  • 83
  • 1
    `Interceptor` will only get called when a request is made. So whenever you are getting the Session Id save it in Some storage maybe in `SharedPreferences` and then get it inside `Interceptor` and set it as header . – ADM Sep 22 '20 at 09:33

0 Answers0