docs: add features page
Summary: Adding a "features" page to the to bar and splitting plugin descriptions from their setup instructions. Reviewed By: jknoxville Differential Revision: D15147464 fbshipit-source-id: b2106d825454c3b2989eb1e536b128ef9b6d0247
This commit is contained in:
committed by
Facebook Github Bot
parent
d9bb1c5cf1
commit
3b03a3d605
38
docs/setup/network-plugin.md
Normal file
38
docs/setup/network-plugin.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
id: network-plugin
|
||||
title: Network Setup
|
||||
sidebar_label: Network
|
||||
---
|
||||
|
||||
To use the network plugin, you need to add the plugin to your Flipper client instance.
|
||||
|
||||
## Android
|
||||
|
||||
```java
|
||||
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
||||
|
||||
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
||||
client.addPlugin(networkFlipperPlugin);
|
||||
```
|
||||
|
||||
### OkHttp Integration
|
||||
|
||||
If you are using the popular OkHttp library, you can use the Interceptors system to automatically hook into your existing stack.
|
||||
|
||||
```java
|
||||
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
||||
|
||||
new OkHttpClient.Builder()
|
||||
.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin))
|
||||
.build();
|
||||
```
|
||||
|
||||
As interceptors can modify the request and response, add the Flipper interceptor after all others to get an accurate view of the network traffic.
|
||||
|
||||
## iOS
|
||||
|
||||
```objective-c
|
||||
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
|
||||
|
||||
[client addPlugin: [FlipperKitNetworkPlugin new]]
|
||||
```
|
||||
Reference in New Issue
Block a user