use of com.bluestacks.bugzy.data.remote.ConnectivityInterceptor in project bugzy by cpunq.
the class NetModule method provideFogBugzService.
@Provides
@Singleton
FogbugzApiService provideFogBugzService(Application application, PrefsHelper prefsHelper, Gson gson) {
OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
Retrofit.Builder builder = new Retrofit.Builder().baseUrl(mBaseUrl).addCallAdapterFactory(new LiveDataCallAdapterFactory(gson)).addConverterFactory(GsonConverterFactory.create(gson));
Retrofit retrofit = builder.client(httpClient.addInterceptor(new ConnectivityInterceptor(application.getApplicationContext())).addInterceptor(new RequestInterceptor(prefsHelper)).build()).build();
return retrofit.create(FogbugzApiService.class);
}
Aggregations