Skip to content

Add local network permission prompt on android 17#57291

Closed
alanjhughes wants to merge 5 commits into
mainfrom
alanhughes/android-37-local-network
Closed

Add local network permission prompt on android 17#57291
alanjhughes wants to merge 5 commits into
mainfrom
alanhughes/android-37-local-network

Conversation

@alanjhughes

@alanjhughes alanjhughes commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary:

Android 17 (SDK 37) introduces Local Network Protection. Reaching any local-network address now requires the runtime ACCESS_LOCAL_NETWORK permission. This is how the dev server is reached, so on an Android 17 device the dev bundle download is blocked

This adds a debug-only path that requests ACCESS_LOCAL_NETWORK before the first bundle load and defers loadApp until the user answers, so a slow response can't cause an error

cc @zoontek

Changelog:

[Android] [Fixed] - Request ACCESS_LOCAL_NETWORK so the dev server stays reachable on Android 17 (SDK 37)[Android] [Added] - Add ACCESS_LOCAL_NETWORK to PermissionsAndroid

Test Plan:

Validated on an Android 17 emulator and physical device.

  • targetSdk 36 and 37
    launch → prompt appears → grant → bundle loads.
    Deny → app starts and shows the normal red-box connection error.
  • API 36 / older devices: no prompt, behavior unchanged.
  • USB device via adb reverse: no prompt (loopback is exempt).

@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 Jun 19, 2026
@alanjhughes alanjhughes requested a review from cortinico June 19, 2026 15:49
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 19, 2026
@github-actions

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@meta-codesync

meta-codesync Bot commented Jun 19, 2026

Copy link
Copy Markdown

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D109160057.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@alanjhughes alanjhughes requested a review from cortinico June 22, 2026 11:08

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 2bc2c8d Jun 22, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jun 22, 2026
@meta-codesync

meta-codesync Bot commented Jun 22, 2026

Copy link
Copy Markdown

@fabriziocucci merged this pull request in 2bc2c8d.

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. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants