Interceptor at native level in react native

585 Views Asked by At

I am using react-native-mapbox-gl library. Sometime layer failed to load or not working.

I want to check which layer service not working. I tried use axios or fetch interceptor but it is not identifying from request from react-native-mapbox-gl library because it is using native network library.

Is there any way to check native interceptor?

1

There are 1 best solutions below

1
hannojg On

I see three strategies here:

  1. Run the app in an android emulator and check the network with android studio. Preferably use an emulator API <= 23 (if I recall there were some issues with intercepting on higher APIs)
  2. Run the app in an iOS simulator and intercept your computers own network traffic with a proxy tool like Charles, Mitm, burp suite etc
  3. Enable flipper for your react native app, install the flipper desktop app and check the network logs there. This might be the easiest solution. However, I find that sometimes flipper doesn't show all the network requests.