Files
flipper/docs/setup/network-plugin.md
Pascal Hartig 6c72fa3dbb Flipper Release: v0.32.0
Summary:
== Highlights ==

- Android: Theme information for Application, Activity and View descriptors are now visible in the Layout plugin. (6f4de969fb)
- App Visualiser: When importing an archived device, you can now see and inspect the last screen of the app. (20db85adf4)

== Fixes ==

- Fix `FlipperKit` warnings in XCode. (972277b031)
- Upgrade Folly to v2020.02.17.00 (GH809)
- Several performance improvements, originally caused by unnecessary rerenders.
- Crash reports weren't scrollable. (e1e8bb841c)
- Kill orhpaned instruments processes. (GH819)

Reviewed By: nikoant

Differential Revision: D20067792

fbshipit-source-id: 3f0ebcb03881373fd909f513e5d82e23a5f9f1f1
2020-02-24 06:53:42 -08:00

1.7 KiB

id, title, sidebar_label
id title sidebar_label
network-plugin Network Setup Network

To use the network plugin, you need to add the plugin to your Flipper client instance.

Android

The network plugin is shipped as a separate Maven artifact:

dependencies {
  debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.32.0'
}

Once added to your dependencies, you can instantiate the plugin and add it to the client:

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.

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

To enable network inspection, add the following pod to your Podfile:

pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version

Initialise the plugin in the following way:

#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>

[[FlipperClient sharedClient] addPlugin: [[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];

import FlipperKit

client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))