expo-cellular 3.1.0 โ†’ 4.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +10 -1
  3. package/android/build.gradle +41 -29
  4. package/android/src/main/java/expo/modules/cellular/CellularGeneration.kt +9 -0
  5. package/android/src/main/java/expo/modules/cellular/CellularModule.kt +102 -0
  6. package/app.plugin.js +1 -0
  7. package/build/Cellular.d.ts +195 -5
  8. package/build/Cellular.js +228 -3
  9. package/build/Cellular.js.map +1 -1
  10. package/build/Cellular.types.d.ts +21 -1
  11. package/build/Cellular.types.js +21 -0
  12. package/build/Cellular.types.js.map +1 -1
  13. package/build/ExpoCellular.d.ts +1 -1
  14. package/build/ExpoCellular.js +1 -1
  15. package/build/ExpoCellular.js.map +1 -1
  16. package/build/ExpoCellular.web.d.ts +5 -0
  17. package/build/ExpoCellular.web.js +16 -4
  18. package/build/ExpoCellular.web.js.map +1 -1
  19. package/expo-module.config.json +10 -0
  20. package/ios/CellularModule.swift +116 -0
  21. package/ios/{EXCellular.podspec โ†’ ExpoCellular.podspec} +13 -5
  22. package/package.json +7 -3
  23. package/plugin/build/withCellular.d.ts +3 -0
  24. package/plugin/build/withCellular.js +12 -0
  25. package/plugin/src/withCellular.ts +13 -0
  26. package/plugin/tsconfig.json +9 -0
  27. package/src/Cellular.ts +240 -6
  28. package/src/Cellular.types.ts +21 -0
  29. package/src/ExpoCellular.ts +1 -1
  30. package/src/ExpoCellular.web.ts +17 -4
  31. package/src/ts-declarations/lib.dom.d.ts +18 -0
  32. package/android/src/main/java/expo/modules/cellular/CellularModule.java +0 -115
  33. package/android/src/main/java/expo/modules/cellular/CellularPackage.java +0 -17
  34. package/ios/EXCellular/EXCellularModule.h +0 -22
  35. package/ios/EXCellular/EXCellularModule.m +0 -90
package/CHANGELOG.md CHANGED
@@ -8,6 +8,57 @@
8
8
 
9
9
  ### ๐Ÿ› Bug fixes
10
10
 
11
+ ### ๐Ÿ’ก Others
12
+
13
+ ## 4.1.1 โ€” 2022-02-01
14
+
15
+ ### ๐Ÿ› Bug fixes
16
+
17
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 4.1.0 โ€” 2021-12-03
20
+
21
+ ### ๐Ÿ’ก Others
22
+
23
+ - Removed legacy Objective-C implementation and changed the pod name to `ExpoCellular`. ([#15082](https://github.com/expo/expo/pull/15082) by [@tsapeta](https://github.com/tsapeta))
24
+
25
+ ## 4.0.0 โ€” 2021-09-28
26
+
27
+ ### ๐Ÿ›  Breaking changes
28
+
29
+ - Deprecated module's constants in favor of new methods returning up-to-date data. ([#13729](https://github.com/expo/expo/pull/13729) by [@m1st4ke](https://github.com/m1st4ke))
30
+ - Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
31
+
32
+ ### ๐ŸŽ‰ New features
33
+
34
+ - Added 5G cellular support ([#13713](https://github.com/expo/expo/pull/13713) by [@m1st4ke](https://github.com/m1st4ke))
35
+ - Added methods returning up-to-date data. ([#13729](https://github.com/expo/expo/pull/13729) by [@m1st4ke](https://github.com/m1st4ke))
36
+
37
+ ### ๐Ÿ› Bug fixes
38
+
39
+ - Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
40
+
41
+ ### ๐Ÿ’ก Others
42
+
43
+ - Added experimental opt-in implementation in Swift ([#13523](https://github.com/expo/expo/pull/13523) by [@tsapeta](https://github.com/tsapeta))
44
+ - Rewrote Android part from Java to Kotlin ([#13694](https://github.com/expo/expo/pull/13694) by [@m1st4ke](https://github.com/m1st4ke))
45
+
46
+ ## 3.2.0 โ€” 2021-06-16
47
+
48
+ ### ๐ŸŽ‰ New features
49
+
50
+ - [plugin] Created config plugin for applying permissions on Android ([#13175](https://github.com/expo/expo/pull/13175) by [@EvanBacon](https://github.com/EvanBacon))
51
+
52
+ ### ๐Ÿ› Bug fixes
53
+
54
+ - Fix null cellular information on iOS. ([#12710](https://github.com/expo/expo/pull/12710) by [@randomhajile](https://github.com/randomhajile))
55
+ - Enable kotlin in all modules. ([#12716](https://github.com/expo/expo/pull/12716) by [@wschurman](https://github.com/wschurman))
56
+ - Add TypeScript types to the exported constants: `allowsVoip`, `carrier`, `isoCountryCode`, `mobileCountryCode` and `mobileNetworkCode`. ([#12838](https://github.com/expo/expo/pull/12838) by [@simek](https://github.com/simek))
57
+
58
+ ### ๐Ÿ’ก Others
59
+
60
+ - Build Android code using Java 8 to fix Android instrumented test build error. ([#12939](https://github.com/expo/expo/pull/12939) by [@kudo](https://github.com/kudo))
61
+
11
62
  ## 3.1.0 โ€” 2021-03-10
12
63
 
13
64
  ### ๐ŸŽ‰ New features
package/README.md CHANGED
@@ -13,7 +13,7 @@ For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
16
- For bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/expo/expo/tree/master/packages/react-native-unimodules) before continuing.
16
+ For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
17
 
18
18
  ### Add the package to your npm dependencies
19
19
 
@@ -21,6 +21,15 @@ For bare React Native projects, you must ensure that you have [installed and con
21
21
  expo install expo-cellular
22
22
  ```
23
23
 
24
+ ### Configure for Android
25
+
26
+ This package requires the `android.permission.READ_PHONE_STATE` be added to your `AndroidManifest.xml`, this is used for `TelephonyManager` on Android. We **do not** require the more risky `READ_PRIVILEGED_PHONE_STATE` permission.
27
+
28
+ ```xml
29
+ <!-- Added permissions -->
30
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
31
+ ```
32
+
24
33
  # Contributing
25
34
 
26
35
  Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
@@ -1,17 +1,23 @@
1
1
  apply plugin: 'com.android.library'
2
- apply plugin: 'maven'
2
+ apply plugin: 'kotlin-android'
3
+ apply plugin: 'maven-publish'
3
4
 
4
5
  group = 'host.exp.exponent'
5
- version = '3.1.0'
6
+ version = '4.1.1'
6
7
 
7
- // Simple helper that allows the root project to override versions declared by this library.
8
- def safeExtGet(prop, fallback) {
9
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
10
- }
8
+ buildscript {
9
+ // Simple helper that allows the root project to override versions declared by this library.
10
+ ext.safeExtGet = { prop, fallback ->
11
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
+ }
13
+
14
+ repositories {
15
+ mavenCentral()
16
+ }
11
17
 
12
- // Upload android library to maven with javadoc and android sources
13
- configurations {
14
- deployerJars
18
+ dependencies {
19
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
20
+ }
15
21
  }
16
22
 
17
23
  // Creating sources with comments
@@ -20,16 +26,19 @@ task androidSourcesJar(type: Jar) {
20
26
  from android.sourceSets.main.java.srcDirs
21
27
  }
22
28
 
23
- // Put the androidSources and javadoc to the artifacts
24
- artifacts {
25
- archives androidSourcesJar
26
- }
27
-
28
- uploadArchives {
29
- repositories {
30
- mavenDeployer {
31
- configuration = configurations.deployerJars
32
- repository(url: mavenLocal().url)
29
+ afterEvaluate {
30
+ publishing {
31
+ publications {
32
+ release(MavenPublication) {
33
+ from components.release
34
+ // Add additional sourcesJar to artifacts
35
+ artifact(androidSourcesJar)
36
+ }
37
+ }
38
+ repositories {
39
+ maven {
40
+ url = mavenLocal().url
41
+ }
33
42
  }
34
43
  }
35
44
  }
@@ -37,25 +46,28 @@ uploadArchives {
37
46
  android {
38
47
  compileSdkVersion safeExtGet("compileSdkVersion", 30)
39
48
 
49
+ compileOptions {
50
+ sourceCompatibility JavaVersion.VERSION_1_8
51
+ targetCompatibility JavaVersion.VERSION_1_8
52
+ }
53
+
54
+ kotlinOptions {
55
+ jvmTarget = JavaVersion.VERSION_1_8
56
+ }
57
+
40
58
  defaultConfig {
41
59
  minSdkVersion safeExtGet("minSdkVersion", 21)
42
60
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
43
61
  versionCode 11
44
- versionName '3.1.0'
62
+ versionName '4.1.1'
45
63
  }
46
64
  lintOptions {
47
65
  abortOnError false
48
66
  }
49
67
  }
50
68
 
51
- if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
52
- apply from: project(":unimodules-core").file("../unimodules-core.gradle")
53
- } else {
54
- throw new GradleException(
55
- '\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
56
- 'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
57
- }
58
-
59
69
  dependencies {
60
- unimodule 'unimodules-core'
70
+ implementation project(':expo-modules-core')
71
+
72
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
61
73
  }
@@ -0,0 +1,9 @@
1
+ package expo.modules.cellular
2
+
3
+ enum class CellularGeneration(val value: Int) {
4
+ UNKNOWN(0),
5
+ CG_2G(1),
6
+ CG_3G(2),
7
+ CG_4G(3),
8
+ CG_5G(4),
9
+ }
@@ -0,0 +1,102 @@
1
+ package expo.modules.cellular
2
+
3
+ import android.annotation.SuppressLint
4
+ import android.content.Context
5
+ import android.net.sip.SipManager
6
+ import android.os.Build
7
+ import android.telephony.TelephonyManager
8
+ import android.util.Log
9
+ import expo.modules.kotlin.modules.Module
10
+ import expo.modules.kotlin.modules.ModuleDefinition
11
+
12
+ const val moduleName = "ExpoCellular"
13
+
14
+ class CellularModule : Module() {
15
+ override fun definition() = ModuleDefinition {
16
+ name(moduleName)
17
+ constants {
18
+ val telephonyManager = telephonyManager()
19
+ mapOf(
20
+ "allowsVoip" to SipManager.isVoipSupported(context),
21
+ "isoCountryCode" to telephonyManager?.simCountryIso,
22
+ "carrier" to telephonyManager?.simOperatorName,
23
+ "mobileCountryCode" to telephonyManager?.simOperator?.substring(0, 3),
24
+ "mobileNetworkCode" to telephonyManager?.simOperator?.substring(3)
25
+ )
26
+ }
27
+
28
+ function("getCellularGenerationAsync") {
29
+ try {
30
+ getCurrentGeneration()
31
+ } catch (e: SecurityException) {
32
+ Log.w(moduleName, "READ_PHONE_STATE permission is required to acquire network type", e)
33
+ CellularGeneration.UNKNOWN.value
34
+ }
35
+ }
36
+
37
+ function("allowsVoipAsync") {
38
+ SipManager.isVoipSupported(context)
39
+ }
40
+
41
+ function("getIsoCountryCodeAsync") {
42
+ telephonyManager()?.simCountryIso
43
+ }
44
+
45
+ function("getCarrierNameAsync") {
46
+ telephonyManager()?.simOperatorName
47
+ }
48
+
49
+ function("getMobileCountryCodeAsync") {
50
+ telephonyManager()?.simOperator?.substring(0, 3)
51
+ }
52
+
53
+ function("getMobileNetworkCodeAsync") {
54
+ telephonyManager()?.simOperator?.substring(3)
55
+ }
56
+ }
57
+
58
+ private fun telephonyManager() =
59
+ (context.getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager).takeIf {
60
+ it?.simState == TelephonyManager.SIM_STATE_READY
61
+ }
62
+
63
+ private val context
64
+ get() = requireNotNull(appContext.reactContext)
65
+
66
+ @SuppressLint("MissingPermission")
67
+ private fun getCurrentGeneration(): Int {
68
+ val telephonyManager = telephonyManager()
69
+ ?: return CellularGeneration.UNKNOWN.value
70
+ val networkType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
71
+ telephonyManager.dataNetworkType
72
+ } else {
73
+ telephonyManager.networkType
74
+ }
75
+ return when (networkType) {
76
+ TelephonyManager.NETWORK_TYPE_GPRS,
77
+ TelephonyManager.NETWORK_TYPE_EDGE,
78
+ TelephonyManager.NETWORK_TYPE_CDMA,
79
+ TelephonyManager.NETWORK_TYPE_1xRTT,
80
+ TelephonyManager.NETWORK_TYPE_IDEN -> {
81
+ CellularGeneration.CG_2G.value
82
+ }
83
+ TelephonyManager.NETWORK_TYPE_UMTS,
84
+ TelephonyManager.NETWORK_TYPE_EVDO_0,
85
+ TelephonyManager.NETWORK_TYPE_EVDO_A,
86
+ TelephonyManager.NETWORK_TYPE_HSDPA,
87
+ TelephonyManager.NETWORK_TYPE_HSUPA,
88
+ TelephonyManager.NETWORK_TYPE_HSPA,
89
+ TelephonyManager.NETWORK_TYPE_EVDO_B,
90
+ TelephonyManager.NETWORK_TYPE_EHRPD,
91
+ TelephonyManager.NETWORK_TYPE_HSPAP -> {
92
+ CellularGeneration.CG_3G.value
93
+ }
94
+ TelephonyManager.NETWORK_TYPE_LTE -> {
95
+ CellularGeneration.CG_4G.value
96
+ }
97
+ else -> {
98
+ CellularGeneration.UNKNOWN.value
99
+ }
100
+ }
101
+ }
102
+ }
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build/withCellular');
@@ -1,8 +1,198 @@
1
1
  import { CellularGeneration } from './Cellular.types';
2
2
  export { CellularGeneration };
3
- export declare const allowsVoip: any;
4
- export declare const carrier: any;
5
- export declare const isoCountryCode: any;
6
- export declare const mobileCountryCode: any;
7
- export declare const mobileNetworkCode: any;
3
+ /**
4
+ * Indicates if the carrier allows making VoIP calls on its network. On Android, this checks whether
5
+ * the system supports SIP-based VoIP API. See [here](https://developer.android.com/reference/android/net/sip/SipManager.html#isVoipSupported(android.content.Context))
6
+ * to view more information.
7
+ *
8
+ * On iOS, if you configure a device for a carrier and then remove the SIM card, this property
9
+ * retains the `boolean` value indicating the carrierโ€™s policy regarding VoIP. If you then install
10
+ * a new SIM card, its VoIP policy `boolean` replaces the previous value of this property.
11
+ *
12
+ * On web, this returns `null`.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * Cellular.allowsVoip; // true or false
17
+ * ```
18
+ * @deprecated Deprecated field, use [`allowsVoipAsync()`](#allowsvoipasync) instead.
19
+ *
20
+ */
21
+ export declare const allowsVoip: boolean | null;
22
+ /**
23
+ * The name of the userโ€™s home cellular service provider. If the device has dual SIM cards, only the
24
+ * carrier for the currently active SIM card will be returned. On Android, this value is only
25
+ * available when the SIM state is [`SIM_STATE_READY`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#SIM_STATE_READY).
26
+ * Otherwise, this returns `null`.
27
+ *
28
+ * On iOS, if you configure a device for a carrier and then remove the SIM card, this property
29
+ * retains the name of the carrier. If you then install a new SIM card, its carrier name replaces
30
+ * the previous value of this property. The value for this property is `null` if the user never
31
+ * configured a carrier for the device.
32
+ *
33
+ * On web, this returns `null`.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * Cellular.carrier; // "T-Mobile" or "Verizon"
38
+ * ```
39
+ * @deprecated Deprecated field, use [`getCarrierNameAsync()`](#getcarriernameasync) instead.
40
+ *
41
+ */
42
+ export declare const carrier: string | null;
43
+ /**
44
+ * The ISO country code for the userโ€™s cellular service provider. On iOS, the value is `null` if any
45
+ * of the following apply:
46
+ * - The device is in airplane mode.
47
+ * - There is no SIM card in the device.
48
+ * - The device is outside of cellular service range.
49
+ *
50
+ * On web, this returns `null`.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * Cellular.isoCountryCode; // "us" or "au"
55
+ * ```
56
+ * @deprecated Deprecated field, use [`getIsoCountryCodeAsync()`](#getisocountrycodeAsync) instead.
57
+ *
58
+ */
59
+ export declare const isoCountryCode: string | null;
60
+ /**
61
+ * The mobile country code (MCC) for the userโ€™s current registered cellular service provider.
62
+ * On Android, this value is only available when SIM state is [`SIM_STATE_READY`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#SIM_STATE_READY). Otherwise, this
63
+ * returns `null`. On iOS, the value may be null on hardware prior to iPhone 4S when in airplane mode.
64
+ * Furthermore, the value for this property is `null` if any of the following apply:
65
+ * - There is no SIM card in the device.
66
+ * - The device is outside of cellular service range.
67
+ *
68
+ * On web, this returns `null`.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * Cellular.mobileCountryCode; // "310"
73
+ * ```
74
+ * @deprecated Deprecated field, use [`getMobileCountryCodeAsync()`](#getmobilecountrycodeasync) instead.
75
+ *
76
+ */
77
+ export declare const mobileCountryCode: string | null;
78
+ /**
79
+ * The ISO country code for the userโ€™s cellular service provider. On iOS, the value is `null` if
80
+ * any of the following apply:
81
+ * - The device is in airplane mode.
82
+ * - There is no SIM card in the device.
83
+ * - The device is outside of cellular service range.
84
+ *
85
+ * On web, this returns `null`.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * Cellular.mobileNetworkCode; // "260"
90
+ * ```
91
+ * @deprecated Deprecated field, use [`getMobileNetworkCodeAsync()`](#getmobilenetworkcodeasync) instead.
92
+ *
93
+ */
94
+ export declare const mobileNetworkCode: string | null;
95
+ /**
96
+ * @return Returns a promise which fulfils with a [`Cellular.CellularGeneration`](#cellulargeneration)
97
+ * enum value that represents the current cellular-generation type.
98
+ *
99
+ * On web, this method uses [`navigator.connection.effectiveType`](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType)
100
+ * to detect the effective type of the connection using a combination of recently observed
101
+ * round-trip time and downlink values. See [here](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API)
102
+ * to view browser compatibility.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * await Cellular.getCellularGenerationAsync();
107
+ * // CellularGeneration.CELLULAR_4G
108
+ * ```
109
+ */
8
110
  export declare function getCellularGenerationAsync(): Promise<CellularGeneration>;
111
+ /**
112
+ * @return Returns if the carrier allows making VoIP calls on its network. On Android, this checks whether
113
+ * the system supports SIP-based VoIP API. See [here](https://developer.android.com/reference/android/net/sip/SipManager.html#isVoipSupported(android.content.Context))
114
+ * to view more information.
115
+ *
116
+ * On iOS, if you configure a device for a carrier and then remove the SIM card, this property
117
+ * retains the `boolean` value indicating the carrierโ€™s policy regarding VoIP. If you then install
118
+ * a new SIM card, its VoIP policy `boolean` replaces the previous value of this property.
119
+ *
120
+ * On web, this returns `null`.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * await Cellular.allowsVoipAsync(); // true or false
125
+ * ```
126
+ */
127
+ export declare function allowsVoipAsync(): Promise<boolean | null>;
128
+ /**
129
+ * @return Returns the ISO country code for the userโ€™s cellular service provider.
130
+ *
131
+ * On iOS, the value is `null` if any of the following apply:
132
+ * - The device is in airplane mode.
133
+ * - There is no SIM card in the device.
134
+ * - The device is outside of cellular service range.
135
+ *
136
+ * On web, this returns `null`.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * await Cellular.getIsoCountryCodeAsync(); // "us" or "au"
141
+ * ```
142
+ *
143
+ */
144
+ export declare function getIsoCountryCodeAsync(): Promise<string | null>;
145
+ /**
146
+ * @return Returns name of the userโ€™s home cellular service provider. If the device has dual SIM cards, only the
147
+ * carrier for the currently active SIM card will be returned.
148
+ *
149
+ * On Android, this value is only available when the SIM state is [`SIM_STATE_READY`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#SIM_STATE_READY).
150
+ * Otherwise, this returns `null`.
151
+ *
152
+ * On iOS, if you configure a device for a carrier and then remove the SIM card, this property
153
+ * retains the name of the carrier. If you then install a new SIM card, its carrier name replaces
154
+ * the previous value of this property. The value for this property is `null` if the user never
155
+ * configured a carrier for the device.
156
+ *
157
+ * On web, this returns `null`.
158
+ *
159
+ * @example
160
+ * ```ts
161
+ * await Cellular.getCarrierNameAsync(); // "T-Mobile" or "Verizon"
162
+ * ```
163
+ */
164
+ export declare function getCarrierNameAsync(): Promise<string | null>;
165
+ /**
166
+ * @return Returns mobile country code (MCC) for the userโ€™s current registered cellular service provider.
167
+ *
168
+ * On Android, this value is only available when SIM state is [`SIM_STATE_READY`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#SIM_STATE_READY). Otherwise, this
169
+ * returns `null`. On iOS, the value may be null on hardware prior to iPhone 4S when in airplane mode.
170
+ * Furthermore, the value for this property is `null` if any of the following apply:
171
+ * - There is no SIM card in the device.
172
+ * - The device is outside of cellular service range.
173
+ *
174
+ * On web, this returns `null`.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * await Cellular.getMobileCountryCodeAsync(); // "310"
179
+ * ```
180
+ */
181
+ export declare function getMobileCountryCodeAsync(): Promise<string | null>;
182
+ /**
183
+ * @return Returns the mobile network code (MNC) for the userโ€™s current registered cellular service provider.
184
+ *
185
+ * On Android, this value is only available when SIM state is [`SIM_STATE_READY`](https://developer.android.com/reference/android/telephony/TelephonyManager.html#SIM_STATE_READY). Otherwise, this
186
+ * returns `null`. On iOS, the value may be null on hardware prior to iPhone 4S when in airplane mode.
187
+ * Furthermore, the value for this property is `null` if any of the following apply:
188
+ * - There is no SIM card in the device.
189
+ * - The device is outside of cellular service range.
190
+ *
191
+ * On web, this returns `null`.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * await Cellular.getMobileNetworkCodeAsync(); // "310"
196
+ * ```
197
+ */
198
+ export declare function getMobileNetworkCodeAsync(): Promise<string | null>;