@Module @InstallIn(SingletonComponent::class)
object AppEntryModule {
private val client = OkHttpClient.Builder().apply {
addInterceptor(MyInterceptor( ????? ))
}.build()
@Provides
@Singleton
fun provideRetrofit(): Retrofit =
Retrofit.Builder()
.baseUrl(MOCK_URL)
.client(client)
.addConverterFactory(GsonConverterFactory.create())
.build()
}
class MyInterceptor @Inject constructor( private val viewLifecycleOwner: LifecycleOwner ) : Interceptor { {}
I found solution: