-
Notifications
You must be signed in to change notification settings - Fork 68
Migrating Network plugin to version 2.1.7
Prateek edited this page Sep 21, 2023
·
1 revision
Till version 2.1.6
, Network plugin was supporting only Okhttp based interceptor. In order to expand the usage, Network plugin adopted interceptor based architecture to enable support for Ktor as well as provided way for custom interception & debugging of network calls.
For integrating, Ktor or Custom intercept, please read.
If you are already using Network plugin with ver 2.1.6, you will need to modify your code to continue using the plugin.
- Till version
2.1.6
, only Okhttp interceptors were supported. Going forward, Okhttp wont be part of base network plugin. You have to add Okhttp interceptor dependency.
Note: If you are using plugin bundle to fetch plugins, no change is needed here, as the following dependency is already present in the bundle.
dependencies {
debugImplementation "com.plutolib.plugins:network-interceptor-okhttp:$plutoVersion"
releaseImplementation "com.plutolib.plugins:network-interceptor-okhttp-no-op:$plutoVersion"
}
- We have moved away from PlutoInterceptor & introduced a new method
addPlutoOkhttpInterceptor()
for intercepting the network calls.
val client = OkHttpClient.Builder()
addPlutoOkhttpInterceptor()
.build()
After these changes, the plugin with start working as before. If you face any bug, please raise an issue for the same.