docs: update network-plugin.mdx android (#2368)

Summary:
Flipper network plugin does not work without the above added lines.

Without the added lines, the network plugin simply does not work on Android with Flipper version 0.91.0. I found this solution in your example react-native project. This should be stated in the docs.

## Changelog

This should not be stated in changelog.

Pull Request resolved: https://github.com/facebook/flipper/pull/2368

Test Plan: There is no code.

Reviewed By: passy

Differential Revision: D28714451

Pulled By: nikoant

fbshipit-source-id: 81583fcf590e1c603d67bcb649067393455549cc
This commit is contained in:
Fazekas Dániel
2021-05-27 03:14:48 -07:00
committed by Facebook GitHub Bot
parent 11b63f18cb
commit 87f739607e

View File

@@ -26,6 +26,12 @@ the client:
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
```