expo-network 6.0.0 → 6.0.1
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.
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '6.0.
|
|
4
|
+
version = '6.0.1'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,6 +14,6 @@ android {
|
|
|
14
14
|
namespace "expo.modules.network"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 11
|
|
17
|
-
versionName '6.0.
|
|
17
|
+
versionName '6.0.1'
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoNetwork.web.d.ts","sourceRoot":"","sources":["../src/ExpoNetwork.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;;yBAGpC,
|
|
1
|
+
{"version":3,"file":"ExpoNetwork.web.d.ts","sourceRoot":"","sources":["../src/ExpoNetwork.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;;yBAGpC,QAAQ,MAAM,CAAC;4BASZ,QAAQ,YAAY,CAAC;;AAVrD,wBAkBE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoNetwork.web.js","sourceRoot":"","sources":["../src/ExpoNetwork.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,eAAe;IACb,KAAK,CAAC,iBAAiB;QACrB,IAAI
|
|
1
|
+
{"version":3,"file":"ExpoNetwork.web.js","sourceRoot":"","sources":["../src/ExpoNetwork.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,eAAe;IACb,KAAK,CAAC,iBAAiB;QACrB,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,mCAAmC,CAAC,CAAC;YAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,EAAE,CAAC;SAChB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,CAAC;SACT;IACH,CAAC;IACD,KAAK,CAAC,oBAAoB;QACxB,MAAM,QAAQ,GAAG,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC;QACtE,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI;YACjE,WAAW,EAAE,QAAQ;YACrB,mBAAmB,EAAE,QAAQ;SAC9B,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { NetworkState, NetworkStateType } from './Network.types';\n\nexport default {\n async getIpAddressAsync(): Promise<string> {\n try {\n const resp = await fetch('https://api.ipify.org?format=json');\n const data = await resp.json();\n return data.ip;\n } catch (e) {\n throw e;\n }\n },\n async getNetworkStateAsync(): Promise<NetworkState> {\n const isOnline = typeof navigator !== 'undefined' && navigator.onLine;\n return {\n type: isOnline ? NetworkStateType.UNKNOWN : NetworkStateType.NONE,\n isConnected: isOnline,\n isInternetReachable: isOnline,\n };\n },\n};\n"]}
|
package/build/Network.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Network.js","sourceRoot":"","sources":["../src/Network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,WAAW,MAAM,eAAe,CAAC;AAC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AC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExpoNetwork from './ExpoNetwork';\nimport { NetworkState, NetworkStateType } from './Network.types';\n\nexport { NetworkState, NetworkStateType };\n\n// @needsAudit\n/**\n * Gets the device's current network connection state.\n *\n * On web, `navigator.connection.type` is not available on browsers. So if there is an active\n * network connection, the field `type` returns `NetworkStateType.UNKNOWN`. Otherwise, it returns\n * `NetworkStateType.NONE`.\n * @return A `Promise` that fulfils with a `NetworkState` object.\n *\n * @example\n * ```ts\n * await Network.getNetworkStateAsync();\n * // {\n * // type: NetworkStateType.CELLULAR,\n * // isConnected: true,\n * // isInternetReachable: true,\n * // }\n * ```\n */\nexport async function getNetworkStateAsync(): Promise<NetworkState> {\n if (!ExpoNetwork.getNetworkStateAsync) {\n throw new UnavailabilityError('expo-network', 'getNetworkStateAsync');\n }\n return await ExpoNetwork.getNetworkStateAsync();\n}\n\n// @needsAudit\n/**\n * Gets the device's current IPv4 address. Returns `0.0.0.0` if the IP address could not be retrieved.\n *\n * On web, this method uses the third-party [`ipify service`](https://www.ipify.org/) to get the\n * public IP address of the current device.\n * @return A `Promise` that fulfils with a `string` of the current IP address of the device's main\n * network interface. Can only be IPv4 address.\n *\n * @example\n * ```ts\n * await Network.getIpAddressAsync();\n * // \"92.168.32.44\"\n * ```\n */\nexport async function getIpAddressAsync(): Promise<string> {\n if (!ExpoNetwork.getIpAddressAsync) {\n throw new UnavailabilityError('expo-network', 'getIpAddressAsync');\n }\n return await ExpoNetwork.getIpAddressAsync();\n}\n\n// @needsAudit\n/**\n * Tells if the device is in airplane mode.\n * @return Returns a `Promise` that fulfils with a `boolean` value for whether the device is in\n * airplane mode or not.\n * @platform android\n *\n * @example\n * ```ts\n * await Network.isAirplaneModeEnabledAsync();\n * // false\n * ```\n */\nexport async function isAirplaneModeEnabledAsync(): Promise<boolean> {\n if (!ExpoNetwork.isAirplaneModeEnabledAsync) {\n throw new UnavailabilityError('expo-network', 'isAirplaneModeEnabledAsync');\n }\n return await ExpoNetwork.isAirplaneModeEnabledAsync();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-network",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
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",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"expo": "*"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "ee4f30ef3b5fa567ad1bf94794197f7683fdd481"
|
|
40
40
|
}
|