Skip to content

Android: default User-Agent includes app name and version (#58147) - #58147

Open
crazeface wants to merge 1 commit into
react:mainfrom
crazeface:export-D116705471
Open

Android: default User-Agent includes app name and version (#58147)#58147
crazeface wants to merge 1 commit into
react:mainfrom
crazeface:export-D116705471

Conversation

@crazeface

@crazeface crazeface commented Aug 25, 2026

Copy link
Copy Markdown

Summary:

On Android, React Native's Networking module fell back to OkHttp's default
User-Agent (okhttp/) when no User-Agent was supplied, so requests
omitted the app name and version. iOS already includes this automatically via the
system networking stack.

This synthesizes a default User-Agent of "AppName/Version" (or just "AppName"
when no versionName is available) from the app's PackageManager, applied only
when no User-Agent is otherwise set. JS-supplied User-Agent headers still take
precedence.

Resolves react-native-community/discussions-and-proposals#284

Changelog:
[Android][Added] - Send app name and version as the default User-Agent header for network requests, matching iOS

Differential Revision: D116705471

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 25, 2026
@meta-codesync

meta-codesync Bot commented Aug 25, 2026

Copy link
Copy Markdown

@crazeface has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116705471.

Summary:

On Android, React Native's Networking module fell back to OkHttp's default
User-Agent (okhttp/<version>) when no User-Agent was supplied, so requests
omitted the app name and version. iOS already includes this automatically via the
system networking stack.

This synthesizes a default User-Agent of "AppName/Version" (or just "AppName"
when no versionName is available) from the app's PackageManager, applied only
when no User-Agent is otherwise set. JS-supplied User-Agent headers still take
precedence.

Resolves react-native-community/discussions-and-proposals#284

Changelog:
[Android][Added] - Send app name and version as the default `User-Agent` header for network requests, matching iOS

Differential Revision: D116705471
@meta-codesync meta-codesync Bot changed the title Android: default User-Agent includes app name and version Android: default User-Agent includes app name and version (#58147) Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default User-Agent header for all networking requests should include the App Name and Version

1 participant