5

We recently upgraded React Native from 0.41 to 0.45 and have since discovered that the OkHttpClient network interceptor we previously set up on Android to change the user agent header for all network requests has stopped working for the fetch and XMLHttpRequest API and now only works for fetching images (using the standard RN Image component).

We are using the exact same network interceptor set up described here React Native & okhttp on Android - Set User-Agent

I think this has been issue since this commit in version 0.43.0 which now prevents customising and replacing the OkHttpClient which is being passed into the NetworkingModule.

Just wondering if anyone else has found a way to set the user agent header on all requests on React Native Android since version 0.43.0.

jroebu14
  • 51
  • 6
  • For anyone else with this issue I was able to solve it with this: https://stackoverflow.com/a/66163168/1795671 – harryisaac Feb 11 '21 at 21:29

0 Answers0