This might sound a noob question but just starting...
# ktor
d
This might sound a noob question but just starting on KMM, I want to create an APIClient as shared module for Android and iOS I need the following features in my
Ktor
Implementation. • It should have local SSL data encryption • InternetConnectionCheck Interceptor • ErrorHandlerInterceptor • RetryRequest After RefreshToken Interceptor • Few other custom interceptors Earlier I was writing my APiClient in the
commonMain
but as I can see it does not support addInterceptor property by default, which is available in OkHttp for Android. So the new plan I had is create an expect class APiClient in common main and implement APIClient for Android on AndroidMain with OkHttp engine and APiClient on iOSMain with IOS Engine. Is this approach right ? or am I missing some part ?
x
it’ll be less work if you keep your interceptors within
commonMain
by utilising ktor plugins for this. Although, i’m not sure how functionally different ktor plugins are for okhttp interceptors