expo-network 56.0.2 → 56.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/android/build.gradle +14 -2
  3. package/android/src/main/java/expo/modules/network/NetworkModule.kt +45 -23
  4. package/android/src/main/java/expo/modules/network/NetworkUtils.kt +45 -0
  5. package/build/Network.types.d.ts +4 -2
  6. package/build/Network.types.d.ts.map +1 -1
  7. package/build/Network.types.js.map +1 -1
  8. package/expo-module.config.json +1 -1
  9. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4-sources.jar +0 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4-sources.jar.md5 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4-sources.jar.sha1 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4-sources.jar.sha256 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4-sources.jar.sha512 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.aar +0 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.aar.md5 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.aar.sha1 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.aar.sha256 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.aar.sha512 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.network/{56.0.2/expo.modules.network-56.0.2.module → 56.0.4/expo.modules.network-56.0.4.module} +22 -22
  20. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.module.md5 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.module.sha1 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.module.sha256 +1 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.module.sha512 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.network/{56.0.2/expo.modules.network-56.0.2.pom → 56.0.4/expo.modules.network-56.0.4.pom} +1 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.pom.md5 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.pom.sha1 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.pom.sha256 +1 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.4/expo.modules.network-56.0.4.pom.sha512 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.network/maven-metadata.xml +4 -4
  30. package/local-maven-repo/host/exp/exponent/expo.modules.network/maven-metadata.xml.md5 +1 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.network/maven-metadata.xml.sha1 +1 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.network/maven-metadata.xml.sha256 +1 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.network/maven-metadata.xml.sha512 +1 -1
  34. package/package.json +4 -4
  35. package/src/Network.types.ts +4 -2
  36. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2-sources.jar +0 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2-sources.jar.md5 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2-sources.jar.sha1 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2-sources.jar.sha256 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2-sources.jar.sha512 +0 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.aar +0 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.aar.md5 +0 -1
  43. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.aar.sha1 +0 -1
  44. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.aar.sha256 +0 -1
  45. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.aar.sha512 +0 -1
  46. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.module.md5 +0 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.module.sha1 +0 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.module.sha256 +0 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.module.sha512 +0 -1
  50. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.pom.md5 +0 -1
  51. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.pom.sha1 +0 -1
  52. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.pom.sha256 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.network/56.0.2/expo.modules.network-56.0.2.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 56.0.4 — 2026-05-19
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 56.0.3 — 2026-05-06
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 56.0.2 — 2026-05-06
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -27,6 +35,7 @@ _This version does not introduce any user-facing changes._
27
35
  ### 🐛 Bug fixes
28
36
 
29
37
  - [Android] Fixed network state listener emitting a stale "connected" event when the device disconnects from the network on Android 13+. ([#44656](https://github.com/expo/expo/pull/44656) by [@gueroverdenwshq](https://github.com/gueroverdenwshq))
38
+ - [Android] Make `isInternetReachable` much more robust. Also emit network state changes when network capabilities change. ([#45101](https://github.com/expo/expo/pull/45101) by [@LumaDevelopment](https://github.com/LumaDevelopment))
30
39
 
31
40
  ## 55.0.13 - 2026-04-09
32
41
 
@@ -4,12 +4,24 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '56.0.2'
7
+ version = '56.0.4'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.network"
11
11
  defaultConfig {
12
12
  versionCode 11
13
- versionName '56.0.2'
13
+ versionName '56.0.4'
14
14
  }
15
+
16
+ testOptions {
17
+ unitTests.includeAndroidResources = true
18
+ }
19
+ }
20
+
21
+ dependencies {
22
+ if (project.findProject(':expo-modules-test-core')) {
23
+ testImplementation project(':expo-modules-test-core')
24
+ }
25
+ testImplementation 'io.mockk:mockk:1.14.9'
26
+ testImplementation "org.robolectric:robolectric:4.16.1"
15
27
  }
@@ -5,7 +5,6 @@ import android.net.ConnectivityManager
5
5
  import android.net.Network
6
6
  import android.net.NetworkCapabilities
7
7
  import android.net.NetworkInfo
8
- import android.net.NetworkRequest
9
8
  import android.net.wifi.WifiInfo
10
9
  import android.net.wifi.WifiManager
11
10
  import android.os.Build
@@ -33,6 +32,9 @@ class NetworkModule : Module() {
33
32
  get() = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
34
33
  private val mainHandler = Handler(Looper.getMainLooper())
35
34
  private val DELAY_MS = 250
35
+ private var isNetworkCallbackRegistered = false
36
+
37
+ private val emitRunnable = Runnable { emitNetworkState() }
36
38
 
37
39
  private val networkCallback = object : ConnectivityManager.NetworkCallback() {
38
40
  override fun onAvailable(network: android.net.Network) {
@@ -61,6 +63,7 @@ class NetworkModule : Module() {
61
63
  //
62
64
  // We still post to the main looper because sendEvent must run on the
63
65
  // main thread; we just skip the artificial delay.
66
+ mainHandler.removeCallbacks(emitRunnable)
64
67
  mainHandler.post {
65
68
  try {
66
69
  val activeNetwork = connectivityManager.activeNetwork
@@ -93,6 +96,10 @@ class NetworkModule : Module() {
93
96
  }
94
97
  }
95
98
  }
99
+
100
+ override fun onCapabilitiesChanged(network: android.net.Network, networkCapabilities: NetworkCapabilities) {
101
+ asyncEmitNetworkState(DELAY_MS)
102
+ }
96
103
  }
97
104
 
98
105
  override fun definition() = ModuleDefinition {
@@ -101,15 +108,29 @@ class NetworkModule : Module() {
101
108
  Events(NETWORK_STATE_EVENT_NAME)
102
109
 
103
110
  OnCreate {
104
- val networkRequest = NetworkRequest.Builder().build()
105
- connectivityManager.registerNetworkCallback(
106
- networkRequest,
107
- networkCallback
108
- )
111
+ try {
112
+ connectivityManager.registerDefaultNetworkCallback(networkCallback)
113
+ isNetworkCallbackRegistered = true
114
+ } catch (e: SecurityException) {
115
+ Log.w(TAG, "expo-network cannot observe internet reachability: missing ACCESS_NETWORK_STATE permission", e)
116
+ } catch (e: RuntimeException) {
117
+ Log.e(TAG, "expo-network cannot observe internet reachability, too many callbacks registered!", e)
118
+ }
109
119
  }
110
120
 
111
121
  OnDestroy {
112
- connectivityManager.unregisterNetworkCallback(networkCallback)
122
+ mainHandler.removeCallbacks(emitRunnable)
123
+ if (isNetworkCallbackRegistered) {
124
+ try {
125
+ connectivityManager.unregisterNetworkCallback(networkCallback)
126
+ } catch (e: SecurityException) {
127
+ Log.w(TAG, "expo-network could not unregister network callback: missing ACCESS_NETWORK_STATE permission", e)
128
+ } catch (e: Exception) {
129
+ Log.w(TAG, "expo-network could not unregister network callback during teardown", e)
130
+ } finally {
131
+ isNetworkCallbackRegistered = false
132
+ }
133
+ }
113
134
  }
114
135
 
115
136
  AsyncFunction("getNetworkStateAsync") {
@@ -141,25 +162,26 @@ class NetworkModule : Module() {
141
162
  }
142
163
 
143
164
  private fun emitNetworkState() {
144
- val networkState = fetchNetworkState()
145
- sendEvent(NETWORK_STATE_EVENT_NAME, networkState)
165
+ try {
166
+ val networkState = fetchNetworkState()
167
+ sendEvent(NETWORK_STATE_EVENT_NAME, networkState)
168
+ } catch (e: SecurityException) {
169
+ Log.w(TAG, "expo-network could not read network state: missing ACCESS_NETWORK_STATE permission", e)
170
+ } catch (e: Exception) {
171
+ // The runnable may outlive the module if the React context is torn down between the
172
+ // ConnectivityManager callback firing and this runnable executing.
173
+ Log.w(TAG, "expo-network dropped a delayed network state update during teardown (the module or React context is no longer available)", e)
174
+ }
146
175
  }
147
176
 
148
177
  /**
149
178
  * Emits the network state with a delay to prevent a race condition.
150
179
  * This delay ensures we read the actual current network state rather than stale information.
180
+ * Debounced: rapid successive calls collapse into a single emission.
151
181
  */
152
182
  private fun asyncEmitNetworkState(delay: Int) {
153
- mainHandler.postDelayed({
154
- try {
155
- emitNetworkState()
156
- } catch (e: SecurityException) {
157
- Log.w(TAG, "expo-network could not read network state: missing ACCESS_NETWORK_STATE permission", e)
158
- } catch (e: Exception) {
159
- // See the matching catch in onLost for the lifecycle race this guards.
160
- Log.w(TAG, "expo-network dropped a delayed network state update during teardown (the module or React context is no longer available)", e)
161
- }
162
- }, delay.toLong())
183
+ mainHandler.removeCallbacks(emitRunnable)
184
+ mainHandler.postDelayed(emitRunnable, delay.toLong())
163
185
  }
164
186
 
165
187
  private fun fetchNetworkState(): Bundle {
@@ -169,7 +191,7 @@ class NetworkModule : Module() {
169
191
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { // use getActiveNetworkInfo before api level 29
170
192
  val netInfo = connectivityManager.activeNetworkInfo
171
193
  val connectionType = getConnectionType(netInfo)
172
- val isInternetReachable = netInfo?.isConnected ?: false
194
+ val isInternetReachable = isInternetReachable(connectivityManager)
173
195
 
174
196
  result.apply {
175
197
  putBoolean("isInternetReachable", isInternetReachable)
@@ -180,9 +202,9 @@ class NetworkModule : Module() {
180
202
  return result
181
203
  } else {
182
204
  val network = connectivityManager.activeNetwork
183
- val isInternetReachable = network != null
205
+ val isInternetReachable = isInternetReachable(connectivityManager)
184
206
 
185
- val connectionType = if (isInternetReachable) {
207
+ val connectionType = if (network != null) {
186
208
  val netCapabilities = connectivityManager.getNetworkCapabilities(network)
187
209
  getConnectionType(netCapabilities)
188
210
  } else {
@@ -211,7 +233,7 @@ class NetworkModule : Module() {
211
233
  val manager = context.getSystemService(Context.WIFI_SERVICE) as WifiManager
212
234
  manager.connectionInfo
213
235
  } catch (e: Exception) {
214
- Log.e(TAG, e.message ?: "Wi-Fi information could not be acquired")
236
+ Log.e(TAG, e.message ?: "expo-network could not acquire Wi-Fi information")
215
237
  throw NetworkWifiException(e)
216
238
  }
217
239
 
@@ -1,7 +1,52 @@
1
1
  package expo.modules.network
2
2
 
3
+ import android.net.ConnectivityManager
4
+ import android.net.NetworkCapabilities
5
+ import android.net.NetworkInfo
6
+ import android.os.Build
7
+ import android.util.Log
8
+
9
+ private val TAG = NetworkModule::class.java.simpleName
10
+
3
11
  internal fun frontPadWithZeros(inputArray: ByteArray): ByteArray {
4
12
  val newByteArray = byteArrayOf(0, 0, 0, 0)
5
13
  System.arraycopy(inputArray, 0, newByteArray, 4 - inputArray.size, inputArray.size)
6
14
  return newByteArray
7
15
  }
16
+
17
+ /**
18
+ * Returns whether the device can reach the Internet.
19
+ * Checks that the active network has both the INTERNET and VALIDATED
20
+ * capabilities, has a usable connection state, and (for VPN connections)
21
+ * has non-zero downstream bandwidth.
22
+ */
23
+ internal fun isInternetReachable(
24
+ connectivityManager: ConnectivityManager,
25
+ sdkInt: Int = Build.VERSION.SDK_INT
26
+ ): Boolean {
27
+ val network = connectivityManager.activeNetwork ?: return false
28
+ val capabilities = connectivityManager.getNetworkCapabilities(network) ?: return false
29
+
30
+ val hasUsableConnectionState = if (sdkInt >= Build.VERSION_CODES.Q) {
31
+ capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED)
32
+ } else {
33
+ val networkInfo = try {
34
+ connectivityManager.getNetworkInfo(network)
35
+ } catch (e: SecurityException) {
36
+ Log.w(TAG, "expo-network could not read network state: missing ACCESS_NETWORK_STATE permission", e)
37
+ null
38
+ }
39
+ networkInfo?.detailedState == NetworkInfo.DetailedState.CONNECTED
40
+ }
41
+
42
+ var isReachable =
43
+ capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
44
+ capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) &&
45
+ hasUsableConnectionState
46
+
47
+ if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
48
+ isReachable = isReachable && capabilities.linkDownstreamBandwidthKbps != 0
49
+ }
50
+
51
+ return isReachable
52
+ }
@@ -12,8 +12,10 @@ export type NetworkState = {
12
12
  isConnected?: boolean;
13
13
  /**
14
14
  * If the internet is reachable with the currently active network connection. On Android, this
15
- * depends on `NetInfo.isConnected()` (API level < 29) or `ConnectivityManager.getActiveNetwork()`
16
- * (API level >= 29). On iOS, this value will always be the same as `isConnected`.
15
+ * requires the active network to have internet capability (`NET_CAPABILITY_INTERNET`), confirmed
16
+ * internet access (`NET_CAPABILITY_VALIDATED`), and a usable connection state. VPN connections
17
+ * also require non-zero downstream bandwidth. On iOS, this value will always be the same as
18
+ * `isConnected`.
17
19
  */
18
20
  isInternetReachable?: boolean;
19
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Network.types.d.ts","sourceRoot":"","sources":["../src/Network.types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAGF;;GAEG;AACH,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,OAAO,YAAY;IACnB;;;;;OAKG;IACH,QAAQ,aAAa;IACrB;;;;OAIG;IACH,IAAI,SAAS;IACb;;;OAGG;IACH,SAAS,cAAc;IACvB;;;;OAIG;IACH,QAAQ,aAAa;IACrB;;;OAGG;IACH,KAAK,UAAU;IACf;;;OAGG;IACH,GAAG,QAAQ;IACX;;;OAGG;IACH,KAAK,UAAU;CAChB;AAGD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACvD,CAAC"}
1
+ {"version":3,"file":"Network.types.d.ts","sourceRoot":"","sources":["../src/Network.types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAGF;;GAEG;AACH,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,OAAO,YAAY;IACnB;;;;;OAKG;IACH,QAAQ,aAAa;IACrB;;;;OAIG;IACH,IAAI,SAAS;IACb;;;OAGG;IACH,SAAS,cAAc;IACvB;;;;OAIG;IACH,QAAQ,aAAa;IACrB;;;OAGG;IACH,KAAK,UAAU;IACf;;;OAGG;IACH,GAAG,QAAQ;IACX;;;OAGG;IACH,KAAK,UAAU;CAChB;AAGD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Network.types.js","sourceRoot":"","sources":["../src/Network.types.ts"],"names":[],"mappings":"AAqBA,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,gBAgDX;AAhDD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,iCAAa,CAAA;IACb;;OAEG;IACH,uCAAmB,CAAA;IACnB;;;;;OAKG;IACH,yCAAqB,CAAA;IACrB;;;;OAIG;IACH,iCAAa,CAAA;IACb;;;OAGG;IACH,2CAAuB,CAAA;IACvB;;;;OAIG;IACH,yCAAqB,CAAA;IACrB;;;OAGG;IACH,mCAAe,CAAA;IACf;;;OAGG;IACH,+BAAW,CAAA;IACX;;;OAGG;IACH,mCAAe,CAAA;AACjB,CAAC,EAhDW,gBAAgB,KAAhB,gBAAgB,QAgD3B","sourcesContent":["// @needsAudit\nexport type NetworkState = {\n /**\n * A [`NetworkStateType`](#networkstatetype) enum value that represents the current network\n * connection type.\n */\n type?: NetworkStateType;\n /**\n * If there is an active network connection. Note that this does not mean that internet is reachable.\n * This field is `false` if the type is either `Network.NetworkStateType.NONE` or `Network.NetworkStateType.UNKNOWN`,\n * `true` otherwise.\n */\n isConnected?: boolean;\n /**\n * If the internet is reachable with the currently active network connection. On Android, this\n * depends on `NetInfo.isConnected()` (API level < 29) or `ConnectivityManager.getActiveNetwork()`\n * (API level >= 29). On iOS, this value will always be the same as `isConnected`.\n */\n isInternetReachable?: boolean;\n};\n\n// @needsAudit\n/**\n * An enum of the different types of devices supported by Expo.\n */\nexport enum NetworkStateType {\n /**\n * No active network connection detected.\n */\n NONE = 'NONE',\n /**\n * The connection type could not be determined.\n */\n UNKNOWN = 'UNKNOWN',\n /**\n * Active network connection over mobile data or [`DUN-specific`](https://developer.android.com/reference/android/net/ConnectivityManager#TYPE_MOBILE_DUN)\n * mobile connection when setting an upstream connection for tethering.\n * @platform android\n * @platform ios\n */\n CELLULAR = 'CELLULAR',\n /**\n * Active network connection over Wi-Fi.\n * @platform android\n * @platform ios\n */\n WIFI = 'WIFI',\n /**\n * Active network connection over Bluetooth.\n * @platform android\n */\n BLUETOOTH = 'BLUETOOTH',\n /**\n * Active network connection over Ethernet.\n * @platform android\n * @platform ios\n */\n ETHERNET = 'ETHERNET',\n /**\n * Active network connection over WiMAX.\n * @platform android\n */\n WIMAX = 'WIMAX',\n /**\n * Active network connection over VPN.\n * @platform android\n */\n VPN = 'VPN',\n /**\n * Active network connection over other network connection types.\n * @platform android\n */\n OTHER = 'OTHER',\n}\n\n// @needsAudit\n/**\n * Represents an event that provides the updated network state when there is a change in the network status.\n * This is passed as the argument to listeners registered with [`addNetworkStateListener()`](#networkaddnetworkstatelistenerlistener).\n */\nexport type NetworkStateEvent = NetworkState;\n\n/**\n * @hidden\n */\nexport type NetworkEvents = {\n onNetworkStateChanged(event: NetworkStateEvent): void;\n};\n"]}
1
+ {"version":3,"file":"Network.types.js","sourceRoot":"","sources":["../src/Network.types.ts"],"names":[],"mappings":"AAuBA,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,gBAgDX;AAhDD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,iCAAa,CAAA;IACb;;OAEG;IACH,uCAAmB,CAAA;IACnB;;;;;OAKG;IACH,yCAAqB,CAAA;IACrB;;;;OAIG;IACH,iCAAa,CAAA;IACb;;;OAGG;IACH,2CAAuB,CAAA;IACvB;;;;OAIG;IACH,yCAAqB,CAAA;IACrB;;;OAGG;IACH,mCAAe,CAAA;IACf;;;OAGG;IACH,+BAAW,CAAA;IACX;;;OAGG;IACH,mCAAe,CAAA;AACjB,CAAC,EAhDW,gBAAgB,KAAhB,gBAAgB,QAgD3B","sourcesContent":["// @needsAudit\nexport type NetworkState = {\n /**\n * A [`NetworkStateType`](#networkstatetype) enum value that represents the current network\n * connection type.\n */\n type?: NetworkStateType;\n /**\n * If there is an active network connection. Note that this does not mean that internet is reachable.\n * This field is `false` if the type is either `Network.NetworkStateType.NONE` or `Network.NetworkStateType.UNKNOWN`,\n * `true` otherwise.\n */\n isConnected?: boolean;\n /**\n * If the internet is reachable with the currently active network connection. On Android, this\n * requires the active network to have internet capability (`NET_CAPABILITY_INTERNET`), confirmed\n * internet access (`NET_CAPABILITY_VALIDATED`), and a usable connection state. VPN connections\n * also require non-zero downstream bandwidth. On iOS, this value will always be the same as\n * `isConnected`.\n */\n isInternetReachable?: boolean;\n};\n\n// @needsAudit\n/**\n * An enum of the different types of devices supported by Expo.\n */\nexport enum NetworkStateType {\n /**\n * No active network connection detected.\n */\n NONE = 'NONE',\n /**\n * The connection type could not be determined.\n */\n UNKNOWN = 'UNKNOWN',\n /**\n * Active network connection over mobile data or [`DUN-specific`](https://developer.android.com/reference/android/net/ConnectivityManager#TYPE_MOBILE_DUN)\n * mobile connection when setting an upstream connection for tethering.\n * @platform android\n * @platform ios\n */\n CELLULAR = 'CELLULAR',\n /**\n * Active network connection over Wi-Fi.\n * @platform android\n * @platform ios\n */\n WIFI = 'WIFI',\n /**\n * Active network connection over Bluetooth.\n * @platform android\n */\n BLUETOOTH = 'BLUETOOTH',\n /**\n * Active network connection over Ethernet.\n * @platform android\n * @platform ios\n */\n ETHERNET = 'ETHERNET',\n /**\n * Active network connection over WiMAX.\n * @platform android\n */\n WIMAX = 'WIMAX',\n /**\n * Active network connection over VPN.\n * @platform android\n */\n VPN = 'VPN',\n /**\n * Active network connection over other network connection types.\n * @platform android\n */\n OTHER = 'OTHER',\n}\n\n// @needsAudit\n/**\n * Represents an event that provides the updated network state when there is a change in the network status.\n * This is passed as the argument to listeners registered with [`addNetworkStateListener()`](#networkaddnetworkstatelistenerlistener).\n */\nexport type NetworkStateEvent = NetworkState;\n\n/**\n * @hidden\n */\nexport type NetworkEvents = {\n onNetworkStateChanged(event: NetworkStateEvent): void;\n};\n"]}
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.network",
11
- "version": "56.0.2",
11
+ "version": "56.0.4",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ 012f1dc241eafa35250a95774539d1018f0cd2dc0a309691938b8ba2b21ffc9f
@@ -0,0 +1 @@
1
+ 743b63ffd72fd1933f210ab6c5d1fe07e068b45fd4dbb30aad632829e0c492b34407cc49483aceeda15f847ce7c5d7bd9c304a2ade1498b3ca4114c4ae5d3a99
@@ -0,0 +1 @@
1
+ d60008645cc2045cc850b1422bdf7aa357c4baf9a5b2578b87ca28b27ed6d2b3
@@ -0,0 +1 @@
1
+ 6870b0ebade57761fe61e7533c54c275001356a7adbdbaf551ce9d81ec5926981f7bd64ba505419f4fe6de964501129b9c76824a0f7de1aa1d209f7e67e01545
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.network",
6
- "version": "56.0.2",
6
+ "version": "56.0.4",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.network-56.0.2.aar",
28
- "url": "expo.modules.network-56.0.2.aar",
29
- "size": 20555,
30
- "sha512": "a3d26f2c9436ef9f3c08360d2217bbe690d78b328656615dca88a0fd8b4b3f4863160aa3eee8dbfb6b3d73e6d142e8a229446c5f9614a393e22c71320e86432e",
31
- "sha256": "4fd123b7d2131cf3a81c7c7f0919f58d7c32330375e6c67a20edb8c4c48877ab",
32
- "sha1": "6d56ce87a88674b78c28becb30573f84f1fb28fe",
33
- "md5": "4a59b8f35ed0cff6933f23a8420d0b86"
27
+ "name": "expo.modules.network-56.0.4.aar",
28
+ "url": "expo.modules.network-56.0.4.aar",
29
+ "size": 22879,
30
+ "sha512": "6870b0ebade57761fe61e7533c54c275001356a7adbdbaf551ce9d81ec5926981f7bd64ba505419f4fe6de964501129b9c76824a0f7de1aa1d209f7e67e01545",
31
+ "sha256": "d60008645cc2045cc850b1422bdf7aa357c4baf9a5b2578b87ca28b27ed6d2b3",
32
+ "sha1": "0a9abad427021775e2af3bb616ca344e8636a6c3",
33
+ "md5": "fd7ecf4c5e846531494a961499be570f"
34
34
  }
35
35
  ]
36
36
  },
@@ -67,13 +67,13 @@
67
67
  ],
68
68
  "files": [
69
69
  {
70
- "name": "expo.modules.network-56.0.2.aar",
71
- "url": "expo.modules.network-56.0.2.aar",
72
- "size": 20555,
73
- "sha512": "a3d26f2c9436ef9f3c08360d2217bbe690d78b328656615dca88a0fd8b4b3f4863160aa3eee8dbfb6b3d73e6d142e8a229446c5f9614a393e22c71320e86432e",
74
- "sha256": "4fd123b7d2131cf3a81c7c7f0919f58d7c32330375e6c67a20edb8c4c48877ab",
75
- "sha1": "6d56ce87a88674b78c28becb30573f84f1fb28fe",
76
- "md5": "4a59b8f35ed0cff6933f23a8420d0b86"
70
+ "name": "expo.modules.network-56.0.4.aar",
71
+ "url": "expo.modules.network-56.0.4.aar",
72
+ "size": 22879,
73
+ "sha512": "6870b0ebade57761fe61e7533c54c275001356a7adbdbaf551ce9d81ec5926981f7bd64ba505419f4fe6de964501129b9c76824a0f7de1aa1d209f7e67e01545",
74
+ "sha256": "d60008645cc2045cc850b1422bdf7aa357c4baf9a5b2578b87ca28b27ed6d2b3",
75
+ "sha1": "0a9abad427021775e2af3bb616ca344e8636a6c3",
76
+ "md5": "fd7ecf4c5e846531494a961499be570f"
77
77
  }
78
78
  ]
79
79
  },
@@ -87,13 +87,13 @@
87
87
  },
88
88
  "files": [
89
89
  {
90
- "name": "expo.modules.network-56.0.2-sources.jar",
91
- "url": "expo.modules.network-56.0.2-sources.jar",
92
- "size": 4773,
93
- "sha512": "0fff2a61f2018c78248426976411bd82cdd9c64c58352e0631a3ced4fcc51953b59fa1df87629a3ec7a6bc5d742205a2fc9a93b26001005593e081727bdd00c7",
94
- "sha256": "e1febb3dc93054124aa5592904d42247829855f7c1b481174c0aab196fda442b",
95
- "sha1": "b9fba1cc155270b1f36bb02291e300c15a8392d8",
96
- "md5": "7762910a10ccb9491ab19298281e251c"
90
+ "name": "expo.modules.network-56.0.4-sources.jar",
91
+ "url": "expo.modules.network-56.0.4-sources.jar",
92
+ "size": 5575,
93
+ "sha512": "743b63ffd72fd1933f210ab6c5d1fe07e068b45fd4dbb30aad632829e0c492b34407cc49483aceeda15f847ce7c5d7bd9c304a2ade1498b3ca4114c4ae5d3a99",
94
+ "sha256": "012f1dc241eafa35250a95774539d1018f0cd2dc0a309691938b8ba2b21ffc9f",
95
+ "sha1": "1120869fc8c001fb9eeaa68263763b5551d6be2d",
96
+ "md5": "27575b44500de7b7a54306c76e2e92c6"
97
97
  }
98
98
  ]
99
99
  }
@@ -0,0 +1 @@
1
+ 7e7dd9b8b14b39abdd44917f73c9c80953814711c012ca53193e5c9d566a035a
@@ -0,0 +1 @@
1
+ 59e7e6c0c7ddc87e891f2bfb670f2e5742f0d2b542fded5f9ad16ec1b2d568740d0e77aa7c325af99dfe086500068de6b69bd50a43c79f041affe2cc562f7d37
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.network</artifactId>
12
- <version>56.0.2</version>
12
+ <version>56.0.4</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.network</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 2ee13a81641557026c056bd8232ee307b5c97f785e04034ced1956a5d45e53ff
@@ -0,0 +1 @@
1
+ 8372d602226dcbd789b2f7e2e54831fe6efd0570840ab492f17a0fc38538fd64553ac8d138f925b49278c2b9cf50200137a52a78201d9397af9dadbb54928360
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.network</artifactId>
5
5
  <versioning>
6
- <latest>56.0.2</latest>
7
- <release>56.0.2</release>
6
+ <latest>56.0.4</latest>
7
+ <release>56.0.4</release>
8
8
  <versions>
9
- <version>56.0.2</version>
9
+ <version>56.0.4</version>
10
10
  </versions>
11
- <lastUpdated>20260506190014</lastUpdated>
11
+ <lastUpdated>20260519105303</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 1eb06d498e39675a63032427d8d80921
1
+ 3840f0b28ef6c868b63085a940e6e791
@@ -1 +1 @@
1
- f45ba607e7258631c157fdc88804aca683a91039
1
+ 7f4d73c0d8e575db42d3c327460803529ec9b770
@@ -1 +1 @@
1
- 334352309a4ad9cdc2e9cd2dd7e1553fbc161334d2e58789183110c1b5e50092
1
+ ec8badf91f5d1c51c9f4aca5ff47358af054b96bfc7bd58fd583cf2ad42707e9
@@ -1 +1 @@
1
- 1df8ee8df98ed05619d821957eeedce65ec43b2dd02358c945a65f4eb9c8b03d747da6f0f353db1ac961284aa45300d726db60144577656c373e558af508865a
1
+ eb467f986d1ed5fcf968127ac91c8227dea428b720e9843470252fe651b29269bddccb4febed3ec2673a5407fbee3dc7e84d9e315db36e2827c7d62a59815bcd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-network",
3
- "version": "56.0.2",
3
+ "version": "56.0.4",
4
4
  "description": "Provides useful information about the device's network such as its IP address, MAC address, and airplane mode status",
5
5
  "main": "build/Network.js",
6
6
  "types": "build/Network.d.ts",
@@ -23,14 +23,14 @@
23
23
  "dependencies": {},
24
24
  "devDependencies": {
25
25
  "@types/react": "~19.2.0",
26
- "expo": "56.0.0-preview.4",
27
- "expo-module-scripts": "56.0.1"
26
+ "expo": "56.0.0-preview.13",
27
+ "expo-module-scripts": "56.0.2"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "expo": "*",
31
31
  "react": "*"
32
32
  },
33
- "gitHead": "d2109c94206280625a070242b0cb6e2500357c46",
33
+ "gitHead": "290368bc41026449a05a4ebf991b85c3a2fb0e3a",
34
34
  "scripts": {
35
35
  "build": "expo-module build",
36
36
  "clean": "expo-module clean",
@@ -13,8 +13,10 @@ export type NetworkState = {
13
13
  isConnected?: boolean;
14
14
  /**
15
15
  * If the internet is reachable with the currently active network connection. On Android, this
16
- * depends on `NetInfo.isConnected()` (API level < 29) or `ConnectivityManager.getActiveNetwork()`
17
- * (API level >= 29). On iOS, this value will always be the same as `isConnected`.
16
+ * requires the active network to have internet capability (`NET_CAPABILITY_INTERNET`), confirmed
17
+ * internet access (`NET_CAPABILITY_VALIDATED`), and a usable connection state. VPN connections
18
+ * also require non-zero downstream bandwidth. On iOS, this value will always be the same as
19
+ * `isConnected`.
18
20
  */
19
21
  isInternetReachable?: boolean;
20
22
  };
@@ -1 +0,0 @@
1
- e1febb3dc93054124aa5592904d42247829855f7c1b481174c0aab196fda442b
@@ -1 +0,0 @@
1
- 0fff2a61f2018c78248426976411bd82cdd9c64c58352e0631a3ced4fcc51953b59fa1df87629a3ec7a6bc5d742205a2fc9a93b26001005593e081727bdd00c7
@@ -1 +0,0 @@
1
- 4fd123b7d2131cf3a81c7c7f0919f58d7c32330375e6c67a20edb8c4c48877ab
@@ -1 +0,0 @@
1
- a3d26f2c9436ef9f3c08360d2217bbe690d78b328656615dca88a0fd8b4b3f4863160aa3eee8dbfb6b3d73e6d142e8a229446c5f9614a393e22c71320e86432e
@@ -1 +0,0 @@
1
- 8cacd1616d8f2c52c2a7c06b69ba0d2bda76e3cd36bbed14bb65aaeb26d7ff12
@@ -1 +0,0 @@
1
- 8cfc926bb262b2dada8063ee57f5f098359b0c1c14e4caa15f96085558272f75498b668dd3f397354af29324c05f92210c341512eb173e7a4fdd11ecfb0a08b9
@@ -1 +0,0 @@
1
- 9d48315f89196bcce562a5a33f9f679bc4bede055aef92754813a8f935a12635
@@ -1 +0,0 @@
1
- 84483c1b4bdf9efac82be3532f2702901a721f830172ee7e7333b09159805f0fb8bb7bc31d7362051c796f7c7b694eec3f07c3531f70c7c5c98603d334b3dc8b