question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How do I get the networkFlipperPlugin for OkHttp interceptor

See original GitHub issue

According to the docs I have to use

.addNetworkInterceptor(FlipperOkhttpInterceptor(networkFlipperPlugin))

but that requires a networkFlipperPlugin. I create the networkFlipperPlugin in my App class though. What’s the best way to do this?

Also, maybe this could be outlined in the docs better?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
waqas19921commented, Nov 18, 2019

For new implementation you have to initialise network interceptor like this.

new FlipperOkhttpInterceptor(AndroidFlipperClient.getInstance(context).getPlugin(NetworkFlipperPlugin.ID)
2reactions
franticncommented, Aug 16, 2019

In Application and your initialize Flipper function

 SoLoader.init(this, false)
val client = AndroidFlipperClient.getInstance(this)
//Network
client.addPlugin(NetworkFlipperPlugin())

Then in your initialize OkHttpClient function

//add flipperOkhttpInterceptor
if(BuildConfig.DEBUG)  {
    okhttpBuilder
        .addNetworkInterceptor(
            AndroidFlipperClient.getInstance(context).getPlugin(NetworkFlipperPlugin.ID))
        )
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Flipper Network Plugin doesn't show network requests
Expose the flipper network plugin in MoveeApp and retrieve it, something like: .addNetworkInterceptor(FlipperOkhttpInterceptor(MoveeApp.
Read more >
Interceptors - OkHttp
Interceptors are a powerful mechanism that can monitor, rewrite, and retry calls. ... Suppose you have both a compressing interceptor and a checksumming ......
Read more >
OkHttp Interceptor in Android
How do you include interceptors in OkHttpClient? ... First, we obtain the request from the chain. request(); The response from the server is ......
Read more >
Logging WebSocket messages in Scarlet with Flipper
In Android the general way to handle network requests is to use Retrofit and OkHttp libraries. This solution offers great debugging functionality by...
Read more >
Adding Interceptors in OkHTTP
First, we get the incoming request by called chain.request() before printing out the headers and request URL. It is important to note that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found