There is scenario, in my staging app where I need ...
# android
s
There is scenario, in my staging app where I need to change my base url provided by user. But issue is I have injected retrofit object using dagger(Using @Provides annotation). Now is it right to re inject my DaggerAppComponent or how should I have been proceeded.
s
You could use an OkHttp Interceptor to intercept requests and set the base URL. Saving the current base url in sharedpreferences / cache / whatever.
s
But I need to reinject okhttpClient it right?
s
No, you’ll inject one okHttpClient with this interceptor
And if you want to only change the base URL base on user input for staging you could inject a dummy version for production and a version which would change the url for staging