[Android] Inappropriate network user agent
See original GitHub issueHi,
Currently making network request will contains the default user agent from okhttp, e.g. okhttp/2.4.0
, this’s not the proper way on the iOS which sets the user agent to product_name/bundle_version
.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Android HTTP User Agent - Stack Overflow
To complete the accepted answer, if you want the default user agent use System.getProperty("http.agent") client.getParams().setParameter(CoreProtocolPNames.
Read more >User-Agent - HTTP - MDN Web Docs - Mozilla
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, ...
Read more >Make your Android's requests shine with a cool User-Agent
Android needs a standard user-agent, so this is my proposal. ... “A user agent that only specified the network client is NOT a...
Read more >User-Agent Reduction - Akamai
Chrome is rolling out changes to the browser's User-Agent string that will affect how web servers, applications, and CDNs like Akamai gather ...
Read more >Understanding Cloudflare User Agent Blocking
User Agent Blocking (UA) rules block specific browser or web application User-Agent request headers. UA rules apply to the entire domain ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s possible to set the user-agent for all network request? Using the same for Android and IOS?
In a nutshell, I tried and failed.
Instead of overriding
NetworkingModule
, I want to modify MainReactPackage.java, initializeNetworkingModule
with the second parameter.Since I can’t access MainReactPackage.java in the sample app which create with
react-native init sample
, so I tried to modify the examplesUIExplorer
inside the master repo, followed with this instruction to install it on my device (5.0.2), but it force stopped immediately once I launched it, the packager is up, and JSMainModule looks fine.http://localhost:8081/Examples/Movies/MoviesApp.android.bundle?platform=android
Neither
UIExplorer
norMovies
will force close, but the app created withreact-native
cli works, 😖