Update Protobuf support (#2381)
Summary: **Update protobuf library with new support for `enum` and `oneof` types** ## Changelog - Update plugin code for library API changes and other cleanup - Add instructions to readme Pull Request resolved: https://github.com/facebook/flipper/pull/2381 Test Plan: see demo app at https://github.com/hbmartin/protobuf_java_to_protobufjs Reviewed By: priteshrnandgaonkar Differential Revision: D28831035 Pulled By: passy fbshipit-source-id: 46e196293330b615394606bd3486ea47ad6a0630
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b7d7326bae
commit
62967314c1
@@ -49,6 +49,25 @@ new OkHttpClient.Builder()
|
||||
|
||||
As interceptors can modify the request and response, add the Flipper interceptor after all others to get an accurate view of the network traffic.
|
||||
|
||||
### Protobuf / Retrofit Integration
|
||||
|
||||
If you are using Retrofit with Protobuf request or response types, you can setup automatic decoding so that the network inspector can display a human readable payload. First you must add the separate dependency:
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
debugImplementation 'com.facebook.flipper:flipper-retrofit2-protobuf-plugin:0.91.2'
|
||||
}
|
||||
```
|
||||
|
||||
Then call `SendProtobufToFlipperFromRetrofit` for each service class.
|
||||
|
||||
```kotlin
|
||||
import com.facebook.flipper.plugins.retrofit2protobuf.SendProtobufToFlipperFromRetrofit
|
||||
|
||||
SendProtobufToFlipperFromRetrofit("https://baseurl.com/", MyApiService::class.java)
|
||||
```
|
||||
|
||||
|
||||
## iOS
|
||||
|
||||
To enable network inspection, add the following pod to your Podfile:
|
||||
|
||||
Reference in New Issue
Block a user