Repository navigation
Description
Minimal reproducible example
Steps to reproduce
While Android blocks an app's network (for example a backgrounded app on Android 15+, blocked=APP_BACKGROUND in dumpsys netpolicy), getActiveNetwork() returns null and expo-network reports isConnected: false. Android reports the block lifting only through NetworkCallback.onBlockedStatusChanged, which NetworkModule.kt doesn't override. So no event is sent, and useNetworkState stays offline until some other network change. The block itself isn't reported either. Related to #47846 / #48478 (same symptom from a stale onLost after a freeze); that fix doesn't cover this case, because onBlockedStatusChanged is the only callback when the block lifts.
Android 16 emulator (google_apis x86_64), release build (npx expo prebuild + ./gradlew assembleRelease), npm:
adb shell cmd connectivity set-chain3-enabled trueandadb shell cmd connectivity set-package-networking-enabled false com.example.expnetrepro- Start the app. It shows
isConnected=false, which is correct. adb shell cmd connectivity set-package-networking-enabled true com.example.expnetrepro- Wait 30 seconds, then press getNetworkStateAsync.
Expected: a network state event with isConnected=true shortly after the block lifts.
Actual: no event. useNetworkState stays isConnected=false, while getNetworkStateAsync returns isConnected=true type=WIFI.
Fix:
override fun onBlockedStatusChanged(network: android.net.Network, blocked: Boolean) {
asyncEmitNetworkState(DELAY_MS)
}With it, and expo-network built from source, the app reported isConnected=true within 3 s of the unblock in 2 of 2 runs; without it, it stayed offline in 2 of 2.
Environment
expo-env-info 2.2.1 environment info:
System:
OS: Linux 6.18 NixOS 26.11
Binaries:
Node: 26.12.0
npm: 11.20.0
SDKs:
Android SDK:
Android NDK: 27.1.12297006
npmPackages:
expo: ~58.0.22 => 58.0.22
react: 19.3.0 => 19.3.0
react-native: 0.88.1 => 0.88.1
Expo Workflow: managed
expo-network 58.0.4.
Expo Doctor Diagnostics
Running 20 checks on your project...
20/20 checks passed. No issues detected!
Activity
expo-bot commentedon Nov 1, 2026
Bug · 80% confidence
This assessment assumes the reported bug is real; the behavior has not been verified.