facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.32k stars 954 forks source link

Question: Network mocking with Flipper for React Native App #3371

Open Gakka opened 2 years ago

Gakka commented 2 years ago

I tried set mock mode in network plugin for react native app in this way

NetworkingModule.setCustomClientBuilder(
          new NetworkingModule.CustomClientBuilder() {
            @Override
            public void apply(OkHttpClient.Builder builder) {
              builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin, true));
            }
          });

After that, I see Mock button in Flipper. After closing Mock Network Responses dialog my mocked responses will not start to work. Is it possible that mock mode in network plugin does not work for react-native app?or are there other ways to connect it for app?

mweststrate commented 2 years ago

cc @bizzguy, you'll probably best know the answer to this one :)

bizzguy commented 2 years ago

@Gakka Unfortunately I don't think this works for react-native apps. I've only personally tested it for Android.