expo-constants 14.4.0 → 14.4.2

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
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 14.4.2 — 2023-06-24
14
+
15
+ ### 💡 Others
16
+
17
+ - Remove the long-deprecated `Constants.deviceYearClass` and `Constants.platform.ios.model`. These properties now live on `expo-device`. ([#23068](https://github.com/expo/expo/pull/23068) by [@brentvatne](https://github.com/brentvatne))
18
+
19
+ ## 14.4.1 — 2023-06-22
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
13
23
  ## 14.4.0 — 2023-06-13
14
24
 
15
25
  ### 🐛 Bug fixes
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '14.4.0'
6
+ version = '14.4.2'
7
7
 
8
8
  apply from: "../scripts/get-app-config-android.gradle"
9
9
 
@@ -69,7 +69,7 @@ android {
69
69
  minSdkVersion safeExtGet("minSdkVersion", 21)
70
70
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
71
71
  versionCode 33
72
- versionName "14.4.0"
72
+ versionName "14.4.2"
73
73
  }
74
74
  lintOptions {
75
75
  abortOnError false
@@ -88,7 +88,6 @@ repositories {
88
88
  dependencies {
89
89
  implementation project(':expo-modules-core')
90
90
 
91
- api 'com.facebook.device.yearclass:yearclass:2.1.0'
92
91
  api "androidx.annotation:annotation:1.0.0"
93
92
  implementation "commons-io:commons-io:2.6"
94
93
 
@@ -2,8 +2,6 @@ package expo.modules.constants
2
2
 
3
3
  import org.apache.commons.io.IOUtils
4
4
 
5
- import com.facebook.device.yearclass.YearClass
6
-
7
5
  import expo.modules.core.interfaces.InternalModule
8
6
  import expo.modules.core.utilities.EmulatorUtilities
9
7
  import expo.modules.interfaces.constants.ConstantsInterface
@@ -45,7 +43,6 @@ open class ConstantsService(private val context: Context) : InternalModule, Cons
45
43
  "sessionId" to sessionId,
46
44
  "executionEnvironment" to ExecutionEnvironment.BARE.string,
47
45
  "statusBarHeight" to statusBarHeightInternal,
48
- "deviceYearClass" to deviceYearClass,
49
46
  "deviceName" to deviceName,
50
47
  "isDevice" to isDevice,
51
48
  "systemFonts" to systemFonts,
@@ -75,8 +72,6 @@ open class ConstantsService(private val context: Context) : InternalModule, Cons
75
72
 
76
73
  override fun getDeviceName(): String = Build.MODEL
77
74
 
78
- override fun getDeviceYearClass() = YearClass.get(context)
79
-
80
75
  override fun getIsDevice() = !EmulatorUtilities.isRunningOnEmulator()
81
76
 
82
77
  override fun getStatusBarHeight() = statusBarHeightInternal
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EAEf,YAAY,EACZ,SAAS,EAET,oBAAoB,EAEpB,WAAW,EAEX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,GACZ,CAAC;;AAuPF,wBAAsC"}
1
+ {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EAEf,YAAY,EACZ,SAAS,EAET,oBAAoB,EAEpB,WAAW,EAEX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,GACZ,CAAC;;AAuNF,wBAAsC"}
@@ -39,8 +39,6 @@ if (!rawManifest && ExponentConstants && ExponentConstants.manifest) {
39
39
  }
40
40
  }
41
41
  const { name, appOwnership, ...nativeConstants } = (ExponentConstants || {});
42
- let warnedAboutDeviceYearClass = false;
43
- let warnedAboutIosModel = false;
44
42
  let warnedAboutManifestField = false;
45
43
  const constants = {
46
44
  ...nativeConstants,
@@ -48,17 +46,6 @@ const constants = {
48
46
  appOwnership: appOwnership ?? null,
49
47
  };
50
48
  Object.defineProperties(constants, {
51
- // Deprecated field
52
- deviceYearClass: {
53
- get() {
54
- if (!warnedAboutDeviceYearClass) {
55
- console.warn(`Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`);
56
- warnedAboutDeviceYearClass = true;
57
- }
58
- return nativeConstants.deviceYearClass;
59
- },
60
- enumerable: false,
61
- },
62
49
  installationId: {
63
50
  get() {
64
51
  return nativeConstants.installationId;
@@ -173,20 +160,6 @@ Object.defineProperties(constants, {
173
160
  enumerable: false,
174
161
  },
175
162
  });
176
- // Add deprecation warning for `platform.ios.model`
177
- if (constants?.platform?.ios) {
178
- const originalModel = nativeConstants.platform.ios.model;
179
- Object.defineProperty(constants.platform.ios, 'model', {
180
- get() {
181
- if (!warnedAboutIosModel) {
182
- console.warn(`Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`);
183
- warnedAboutIosModel = true;
184
- }
185
- return originalModel;
186
- },
187
- enumerable: false,
188
- });
189
- }
190
163
  function isAppManifest(manifest) {
191
164
  return !isManifest(manifest);
192
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAGL,YAAY,EAGZ,oBAAoB,EAMpB,kBAAkB,GAEnB,MAAM,mBA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AAED,SAAS,aAAa,CAAC,QAAgC;IACrD,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,UAAU,CAAC,QAAgC;IAClD,OAAO,UAAU,IAAI,QAAQ,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,eAAe,GAAG,KAAK;IAC1C,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,mBAAmB,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;QACxE,IACE,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,IAAI;YAClE,QAAQ,CAAC,EAAE,KAAK,KAAK,EACrB;YACA,IAAI,CAAC,eAAe,EAAE;gBACpB,OAAO,CAAC,IAAI,CACV,yBAAyB,mBAAmB,kKAAkK,CAC/M,CAAC;aACH;SACF;aAAM,IACL,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,WAAW;YACzE,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,UAAU,EACxE;YACA,sEAAsE;YACtE,mEAAmE;YACnE,MAAM,IAAI,UAAU,CAClB,oCAAoC,EACpC,yBAAyB,mBAAmB,sBAAsB,CACnE,CAAC;SACH;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,SAAsB,CAAC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n EASConfig,\n ExecutionEnvironment,\n ExpoGoConfig,\n IOSManifest,\n Manifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n};\n\nif (!ExponentConstants) {\n console.warn(\n \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n );\n}\n\nlet rawManifest: AppManifest | Manifest | null = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n let updatesManifest;\n if (NativeModulesProxy.ExpoUpdates.manifest) {\n updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n }\n if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n rawManifest = updatesManifest;\n }\n}\n\n// If dev-launcher defines a non-empty manifest, prefer that one\nif (NativeModules.EXDevLauncher) {\n let devLauncherManifest;\n if (NativeModules.EXDevLauncher.manifestString) {\n devLauncherManifest = JSON.parse(NativeModules.EXDevLauncher.manifestString);\n }\n\n if (devLauncherManifest && Object.keys(devLauncherManifest).length > 0) {\n rawManifest = devLauncherManifest;\n }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!rawManifest && ExponentConstants && ExponentConstants.manifest) {\n rawManifest = ExponentConstants.manifest;\n // On Android we pass the manifest in JSON form so this step is necessary\n if (typeof rawManifest === 'string') {\n rawManifest = JSON.parse(rawManifest);\n }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nlet warnedAboutDeviceYearClass = false;\nlet warnedAboutIosModel = false;\nlet warnedAboutManifestField = false;\n\nconst constants: Constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n};\n\nObject.defineProperties(constants, {\n // Deprecated field\n deviceYearClass: {\n get() {\n if (!warnedAboutDeviceYearClass) {\n console.warn(\n `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`\n );\n warnedAboutDeviceYearClass = true;\n }\n return nativeConstants.deviceYearClass;\n },\n enumerable: false,\n },\n installationId: {\n get() {\n return nativeConstants.installationId;\n },\n enumerable: false,\n },\n /**\n * Use `manifest` property by default.\n * This property is only used for internal purposes.\n * It behaves similarly to the original one, but suppresses warning upon no manifest available.\n * `expo-asset` uses it to prevent users from seeing mentioned warning.\n */\n __unsafeNoWarnManifest: {\n get(): AppManifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n __unsafeNoWarnManifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n manifest: {\n get(): AppManifest | null {\n if (__DEV__ && !warnedAboutManifestField) {\n console.warn(`Constants.manifest has been deprecated in favor of Constants.expoConfig.`);\n warnedAboutManifestField = true;\n }\n\n const maybeManifest = getManifest();\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n manifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n expoConfig: {\n get():\n | (ExpoConfig & {\n /**\n * Only present during development using @expo/cli.\n */\n hostUri?: string;\n })\n | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.expoClient ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n expoGoConfig: {\n get(): ExpoGoConfig | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.expoGo ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n easConfig: {\n get(): EASConfig | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.eas ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n __rawManifest_TEST: {\n get(): AppManifest | Manifest | null {\n return rawManifest;\n },\n set(value: AppManifest | Manifest | null) {\n rawManifest = value;\n },\n enumerable: false,\n },\n});\n\n// Add deprecation warning for `platform.ios.model`\nif (constants?.platform?.ios) {\n const originalModel = nativeConstants.platform.ios.model;\n Object.defineProperty(constants.platform.ios, 'model', {\n get() {\n if (!warnedAboutIosModel) {\n console.warn(\n `Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`\n );\n warnedAboutIosModel = true;\n }\n return originalModel;\n },\n enumerable: false,\n });\n}\n\nfunction isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {\n return !isManifest(manifest);\n}\n\nfunction isManifest(manifest: AppManifest | Manifest): manifest is Manifest {\n return 'metadata' in manifest;\n}\n\nfunction getManifest(suppressWarning = false): AppManifest | Manifest | null {\n if (!rawManifest) {\n const invalidManifestType = rawManifest === null ? 'null' : 'undefined';\n if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n Platform.OS !== 'web'\n ) {\n if (!suppressWarning) {\n console.warn(\n `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n );\n }\n } else if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n ) {\n // If we somehow get here, this is a truly exceptional state to be in.\n // Constants.manifest should *always* be defined in those contexts.\n throw new CodedError(\n 'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n `Constants.manifest is ${invalidManifestType}, must be an object.`\n );\n }\n }\n return rawManifest;\n}\n\nexport default constants as Constants;\n"]}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,CAAC,IAAI,CACV,yBAAyB,mBAAmB,kKAAkK,CAC/M,CAAC;aACH;SACF;aAAM,IACL,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,WAAW;YACzE,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,UAAU,EACxE;YACA,sEAAsE;YACtE,mEAAmE;YACnE,MAAM,IAAI,UAAU,CAClB,oCAAoC,EACpC,yBAAyB,mBAAmB,sBAAsB,CACnE,CAAC;SACH;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,SAAsB,CAAC","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n EASConfig,\n ExecutionEnvironment,\n ExpoGoConfig,\n IOSManifest,\n Manifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n};\n\nif (!ExponentConstants) {\n console.warn(\n \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n );\n}\n\nlet rawManifest: AppManifest | Manifest | null = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n let updatesManifest;\n if (NativeModulesProxy.ExpoUpdates.manifest) {\n updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n }\n if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n rawManifest = updatesManifest;\n }\n}\n\n// If dev-launcher defines a non-empty manifest, prefer that one\nif (NativeModules.EXDevLauncher) {\n let devLauncherManifest;\n if (NativeModules.EXDevLauncher.manifestString) {\n devLauncherManifest = JSON.parse(NativeModules.EXDevLauncher.manifestString);\n }\n\n if (devLauncherManifest && Object.keys(devLauncherManifest).length > 0) {\n rawManifest = devLauncherManifest;\n }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!rawManifest && ExponentConstants && ExponentConstants.manifest) {\n rawManifest = ExponentConstants.manifest;\n // On Android we pass the manifest in JSON form so this step is necessary\n if (typeof rawManifest === 'string') {\n rawManifest = JSON.parse(rawManifest);\n }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nlet warnedAboutManifestField = false;\n\nconst constants: Constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n};\n\nObject.defineProperties(constants, {\n installationId: {\n get() {\n return nativeConstants.installationId;\n },\n enumerable: false,\n },\n /**\n * Use `manifest` property by default.\n * This property is only used for internal purposes.\n * It behaves similarly to the original one, but suppresses warning upon no manifest available.\n * `expo-asset` uses it to prevent users from seeing mentioned warning.\n */\n __unsafeNoWarnManifest: {\n get(): AppManifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n __unsafeNoWarnManifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n manifest: {\n get(): AppManifest | null {\n if (__DEV__ && !warnedAboutManifestField) {\n console.warn(`Constants.manifest has been deprecated in favor of Constants.expoConfig.`);\n warnedAboutManifestField = true;\n }\n\n const maybeManifest = getManifest();\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n manifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n expoConfig: {\n get():\n | (ExpoConfig & {\n /**\n * Only present during development using @expo/cli.\n */\n hostUri?: string;\n })\n | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.expoClient ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n expoGoConfig: {\n get(): ExpoGoConfig | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.expoGo ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n easConfig: {\n get(): EASConfig | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest) {\n return null;\n }\n\n if (isManifest(maybeManifest)) {\n return maybeManifest.extra?.eas ?? null;\n } else if (isAppManifest(maybeManifest)) {\n return maybeManifest;\n }\n\n return null;\n },\n enumerable: true,\n },\n __rawManifest_TEST: {\n get(): AppManifest | Manifest | null {\n return rawManifest;\n },\n set(value: AppManifest | Manifest | null) {\n rawManifest = value;\n },\n enumerable: false,\n },\n});\n\nfunction isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {\n return !isManifest(manifest);\n}\n\nfunction isManifest(manifest: AppManifest | Manifest): manifest is Manifest {\n return 'metadata' in manifest;\n}\n\nfunction getManifest(suppressWarning = false): AppManifest | Manifest | null {\n if (!rawManifest) {\n const invalidManifestType = rawManifest === null ? 'null' : 'undefined';\n if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n Platform.OS !== 'web'\n ) {\n if (!suppressWarning) {\n console.warn(\n `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n );\n }\n } else if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n ) {\n // If we somehow get here, this is a truly exceptional state to be in.\n // Constants.manifest should *always* be defined in those contexts.\n throw new CodedError(\n 'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n `Constants.manifest is ${invalidManifestType}, must be an object.`\n );\n }\n }\n return rawManifest;\n}\n\nexport default constants as Constants;\n"]}
@@ -21,7 +21,6 @@ FOUNDATION_EXPORT NSString * const EXConstantsExecutionEnvironmentStoreClient;
21
21
  - (NSArray<NSString *> *)systemFontNames;
22
22
 
23
23
  + (NSString *)devicePlatform;
24
- + (nullable NSString *)deviceModel;
25
24
  + (NSNumber *)deviceYear;
26
25
  + (NSString *)deviceName;
27
26
 
@@ -56,7 +56,6 @@ EX_REGISTER_MODULE();
56
56
  @"sessionId": _sessionId,
57
57
  @"executionEnvironment": EXConstantsExecutionEnvironmentBare,
58
58
  @"statusBarHeight": @([self statusBarHeight]),
59
- @"deviceYearClass": [[self class] deviceYear],
60
59
  @"deviceName": [[self class] deviceName],
61
60
  @"isDevice": @([self isDevice]),
62
61
  @"systemFonts": [self systemFontNames],
@@ -70,7 +69,6 @@ EX_REGISTER_MODULE();
70
69
  @"ios": @{
71
70
  @"buildNumber": [self buildVersion],
72
71
  @"platform": [[self class] devicePlatform],
73
- @"model": EXNullIfNil([[self class] deviceModel]),
74
72
  @"userInterfaceIdiom": [self userInterfaceIdiom],
75
73
  @"systemVersion": [self iosVersion],
76
74
  },
@@ -161,316 +159,6 @@ EX_REGISTER_MODULE();
161
159
  return platform;
162
160
  }
163
161
 
164
- + (nullable NSString *)deviceModel
165
- {
166
- NSString *platform = [self devicePlatform];
167
- NSDictionary *mapping = @{
168
- // Apple TV
169
- @"AppleTV2,1": @"Apple TV 2G",
170
- @"AppleTV3,1": @"Apple TV 3G",
171
- @"AppleTV3,2": @"Apple TV 3G",
172
- @"AppleTV5,3": @"Apple TV 4G",
173
- @"AppleTV6,2": @"Apple TV 4k",
174
-
175
- // Apple Watch
176
- @"Watch1,1": @"Apple Watch",
177
- @"Watch1,2": @"Apple Watch",
178
- @"Watch2,6": @"Apple Watch Series 1",
179
- @"Watch2,7": @"Apple Watch Series 1",
180
- @"Watch2,3": @"Apple Watch Series 2",
181
- @"Watch2,4": @"Apple Watch Series 2",
182
- @"Watch3,1": @"Apple Watch Series 3",
183
- @"Watch3,2": @"Apple Watch Series 3",
184
- @"Watch3,3": @"Apple Watch Series 3",
185
- @"Watch3,4": @"Apple Watch Series 3",
186
- @"Watch4,1": @"Apple Watch Series 4",
187
- @"Watch4,2": @"Apple Watch Series 4",
188
- @"Watch4,3": @"Apple Watch Series 4",
189
- @"Watch4,4": @"Apple Watch Series 4",
190
- @"Watch5,1": @"Apple Watch Series 5",
191
- @"Watch5,2": @"Apple Watch Series 5",
192
- @"Watch5,3": @"Apple Watch Series 5",
193
- @"Watch5,4": @"Apple Watch Series 5",
194
- @"Watch6,1": @"Apple Watch Series 6",
195
- @"Watch6,2": @"Apple Watch Series 6",
196
- @"Watch6,3": @"Apple Watch Series 6",
197
- @"Watch6,4": @"Apple Watch Series 6",
198
-
199
- // iPhone
200
- // iOS 12+
201
- @"iPhone6,1": @"iPhone 5S (GSM)",
202
- @"iPhone6,2": @"iPhone 5S (GSM+CDMA)",
203
- @"iPhone7,1": @"iPhone 6 Plus",
204
- @"iPhone7,2": @"iPhone 6",
205
-
206
- // iOS 13+
207
- @"iPhone8,1": @"iPhone 6s",
208
- @"iPhone8,2": @"iPhone 6s Plus",
209
- @"iPhone8,4": @"iPhone SE",
210
- @"iPhone9,1": @"iPhone 7",
211
- @"iPhone9,3": @"iPhone 7",
212
- @"iPhone9,2": @"iPhone 7 Plus",
213
- @"iPhone9,4": @"iPhone 7 Plus",
214
- @"iPhone10,1": @"iPhone 8",
215
- @"iPhone10,4": @"iPhone 8",
216
- @"iPhone10,2": @"iPhone 8 Plus",
217
- @"iPhone10,5": @"iPhone 8 Plus",
218
- @"iPhone10,3": @"iPhone X",
219
- @"iPhone10,6": @"iPhone X",
220
- @"iPhone11,2": @"iPhone Xs",
221
- @"iPhone11,4": @"iPhone Xs Max", // A1921, A2103
222
- @"iPhone11,6": @"iPhone Xs Max", // A2104
223
- @"iPhone11,8": @"iPhone Xr", // A1882, A1719, A2105
224
- @"iPhone12,1": @"iPhone 11",
225
- @"iPhone12,3": @"iPhone 11 Pro",
226
- @"iPhone12,5": @"iPhone 11 Pro Max",
227
- @"iPhone12,8": @"iPhone SE",
228
- @"iPhone13,1": @"iPhone 12 mini",
229
- @"iPhone13,2": @"iPhone 12",
230
- @"iPhone13,3": @"iPhone 12 Pro",
231
- @"iPhone13,4": @"iPhone 12 Pro Max",
232
-
233
- @"iPhone14,2": @"iPhone 13 Pro",
234
- @"iPhone14,3": @"iPhone 13 Pro Max",
235
- @"iPhone14,4": @"iPhone 13 Mini",
236
- @"iPhone14,5": @"iPhone 13",
237
-
238
- // iPod
239
- @"iPod1,1": @"iPod Touch",
240
- @"iPod2,1": @"iPod Touch 2G",
241
- @"iPod3,1": @"iPod Touch 3G",
242
- @"iPod4,1": @"iPod Touch 4G",
243
- @"iPod5,1": @"iPod Touch 5G",
244
- @"iPod7,1": @"iPod Touch 6G",
245
- @"iPod9,1": @"iPod Touch 7G",
246
-
247
- // iPad
248
- @"iPad1,1": @"iPad",
249
- @"iPad2,1": @"iPad 2 (WiFi)",
250
- @"iPad2,2": @"iPad 2 (GSM)",
251
- @"iPad2,3": @"iPad 2 (CDMA)",
252
- @"iPad2,4": @"iPad 2 (WiFi)",
253
- @"iPad2,5": @"iPad Mini (WiFi)",
254
- @"iPad2,6": @"iPad Mini (GSM)",
255
- @"iPad2,7": @"iPad Mini (GSM+CDMA)",
256
- @"iPad3,1": @"iPad 3 (WiFi)",
257
- @"iPad3,2": @"iPad 3 (GSM+CDMA)",
258
- @"iPad3,3": @"iPad 3 (GSM)",
259
- @"iPad3,4": @"iPad 4 (WiFi)",
260
- @"iPad3,5": @"iPad 4 (GSM)",
261
- @"iPad3,6": @"iPad 4 (GSM+CDMA)",
262
- @"iPad4,1": @"iPad Air (WiFi)",
263
- @"iPad4,2": @"iPad Air (Cellular)",
264
- @"iPad4,3": @"iPad Air",
265
- @"iPad4,4": @"iPad Mini 2 (WiFi)",
266
- @"iPad4,5": @"iPad Mini 2 (Cellular)",
267
- @"iPad4,6": @"iPad Mini 2",
268
- @"iPad4,7": @"iPad mini 3 (WiFi)",
269
- @"iPad4,8": @"iPad mini 3 (Cellular)",
270
- @"iPad4,9": @"iPad mini 3 (China Model)",
271
- @"iPad5,1": @"iPad mini 4 (WiFi)",
272
- @"iPad5,2": @"iPad mini 4 (Cellular)",
273
- @"iPad5,3": @"iPad Air 2 (WiFi)",
274
- @"iPad5,4": @"iPad Air 2 (Cellular)",
275
- @"iPad6,3": @"iPad Pro 9.7 inch (WiFi)",
276
- @"iPad6,4": @"iPad Pro 9.7 inch (Cellular)",
277
- @"iPad6,7": @"iPad Pro (WiFi)",
278
- @"iPad6,8": @"iPad Pro (Cellular)",
279
- @"iPad6,11": @"iPad 5th Generation (WiFi)",
280
- @"iPad6,12": @"iPad 5th Generation (Cellular)",
281
- @"iPad7,1": @"iPad Pro 12.9 inch (WiFi)",
282
- @"iPad7,2": @"iPad Pro 12.9 inch (Cellular)",
283
- @"iPad7,3": @"iPad Pro 10.5 inch (WiFi)",
284
- @"iPad7,4": @"iPad Pro 10.5 inch (Cellular)",
285
- @"iPad7,5": @"iPad 9.7 inch (WiFi)",
286
- @"iPad7,6": @"iPad 9.7 inch (Cellular)",
287
- @"iPad7,11": @"iPad (7th generation)",
288
- @"iPad7,12": @"iPad (7th generation)",
289
- @"iPad8,1": @"iPad Pro 11-inch (3rd generation)",
290
- @"iPad8,2": @"iPad Pro 11-inch (3rd generation)",
291
- @"iPad8,3": @"iPad Pro 11-inch (3rd generation)",
292
- @"iPad8,4": @"iPad Pro 11-inch (3rd generation)",
293
- @"iPad8,5": @"iPad Pro 12.9-inch (3rd generation)",
294
- @"iPad8,6": @"iPad Pro 12.9-inch (3rd generation)",
295
- @"iPad8,7": @"iPad Pro 12.9-inch (3rd generation)",
296
- @"iPad8,8": @"iPad Pro 12.9-inch (3rd generation)",
297
- @"iPad11,1": @"iPad Mini (5th generation) (WiFi)",
298
- @"iPad11,2": @"iPad Mini (5th generation)",
299
- @"iPad11,3": @"iPad Air (3rd generation) (WiFi)",
300
- @"iPad11,4": @"iPad Air (3rd generation)",
301
-
302
- @"iPad11,6": @"iPad (8th generation)",
303
- @"iPad11,7": @"iPad (8th generation)",
304
- @"iPad13,1": @"iPad Air (4th generation) (WiFi)",
305
- @"iPad13,2": @"iPad Air (4th generation) (WiFi+Cellular)",
306
- @"iPad13,4": @"iPad Pro 11 inch (3th generation)",
307
- @"iPad13,5": @"iPad Pro 11 inch (3th generation)",
308
- @"iPad13,6": @"iPad Pro 11 inch (3th generation)",
309
- @"iPad13,7": @"iPad Pro 11 inch (3th generation)",
310
- @"iPad13,8": @"iPad Pro 12.9 inch (5th generation)",
311
- @"iPad13,9": @"iPad Pro 12.9 inch (5th generation)",
312
- @"iPad13,10": @"iPad Pro 12.9 inch (5th generation)",
313
- @"iPad13,11": @"iPad Pro 12.9 inch (5th generation)",
314
- @"iPad14,1": @"iPad Mini (6th generation) (WiFi)",
315
- @"iPad14,2": @"iPad Mini (6th generation) (WiFi+Cellular)",
316
- // Simulator
317
- @"i386": @"Simulator",
318
- @"arm64": @"Simulator",
319
- @"x86_64": @"Simulator",
320
- };
321
-
322
- NSString *deviceModel = mapping[platform];
323
-
324
- if (!deviceModel) {
325
- // Not found in the database. At least guess main device type from string contents.
326
-
327
- if ([platform rangeOfString:@"iPod"].location != NSNotFound) {
328
- deviceModel = @"iPod Touch";
329
- } else if ([platform rangeOfString:@"iPad"].location != NSNotFound) {
330
- deviceModel = @"iPad";
331
- } else if ([platform rangeOfString:@"iPhone"].location != NSNotFound){
332
- deviceModel = @"iPhone";
333
- } else if ([platform rangeOfString:@"AppleTV"].location != NSNotFound){
334
- deviceModel = @"Apple TV";
335
- }
336
- }
337
- return deviceModel;
338
- }
339
-
340
- + (NSNumber *)deviceYear
341
- {
342
- NSString *platform = [self devicePlatform];
343
-
344
- // TODO: apple TV and apple watch
345
- NSDictionary *mapping = @{
346
- @"iPhone6,1": @2013,
347
- @"iPhone6,2": @2013,
348
-
349
- @"iPhone7,1": @2014, // iPhone 6 Plus
350
- @"iPhone7,2": @2014, // iPhone 6
351
- @"iPhone8,1": @2015, // iPhone 6S
352
- @"iPhone8,2": @2015, // iPhone 6S Plus
353
- @"iPhone8,4": @2016, // iPhone SE
354
- @"iPhone9,1": @2016, // iPhone 7
355
- @"iPhone9,3": @2016, // iPhone 7 Plus
356
- @"iPhone9,2": @2016, // iPhone 7
357
- @"iPhone9,4": @2016, // iPhone 7 Plus
358
- @"iPhone10,1": @2017, // iPhone 8
359
- @"iPhone10,2": @2017, // iPhone 8 Plus
360
- @"iPhone10,3": @2017, // iPhone X Global
361
- @"iPhone10,4": @2017, // iPhone 8
362
- @"iPhone10,5": @2017, // iPhone 8 Plus
363
- @"iPhone10,6": @2017, // iPhone X GSM
364
- @"iPhone11,2": @2018, // iPhone Xs
365
- @"iPhone11,4": @2018, // iPhone Xs Max
366
- @"iPhone11,6": @2018, // iPhone Xs Max Global
367
- @"iPhone11,8": @2018, // iPhone Xr
368
- @"iPhone12,1": @2019, // iPhone 11
369
- @"iPhone12,3": @2019, // iPhone 11 Pro
370
- @"iPhone12,5": @2019, // iPhone 11 Pro Max
371
- @"iPhone12,8": @2020, // iPhone SE 2nd Gen
372
- @"iPhone13,1": @2020, // iPhone 12 mini
373
- @"iPhone13,2": @2020, // iPhone 12
374
- @"iPhone13,3": @2020, // iPhone 12 Pro
375
- @"iPhone13,4": @2020, // iPhone 12 Pro Max
376
- @"iPhone14,2": @2021, // iPhone 13 Pro
377
- @"iPhone14,3": @2021, // iPhone 13 Pro Max
378
- @"iPhone14,4": @2021, // iPhone 13 Mini
379
- @"iPhone14,5": @2021, // iPhone 13
380
-
381
- // iPod
382
- @"iPod1,1": @2007,
383
- @"iPod2,1": @2008,
384
- @"iPod3,1": @2009,
385
- @"iPod4,1": @2010,
386
- @"iPod5,1": @2012,
387
- @"iPod7,1": @2015, // iPod 6th Gen
388
- @"iPod9,1": @2019, // iPod 7th Gen
389
-
390
- // iPad
391
- @"iPad1,1": @2010,
392
- @"iPad2,1": @2011,
393
- @"iPad2,2": @2011,
394
- @"iPad2,3": @2011,
395
- @"iPad2,4": @2011,
396
- @"iPad2,5": @2012, // iPad Mini (WiFi)
397
- @"iPad2,6": @2012, // iPad Mini (GSM+LTE)
398
- @"iPad2,7": @2012, // iPad Mini (CDMA+LTE)
399
- @"iPad3,1": @2012,
400
- @"iPad3,2": @2012,
401
- @"iPad3,3": @2012,
402
- @"iPad3,4": @2013,
403
- @"iPad3,5": @2013,
404
- @"iPad3,6": @2013,
405
- @"iPad4,1": @2013,
406
- @"iPad4,2": @2013,
407
- @"iPad4,3": @2013,
408
- @"iPad4,4": @2013, // iPad Mini Retina (WiFi)
409
- @"iPad4,5": @2013, // iPad Mini Retina (GSM+CDMA)
410
- @"iPad4,6": @2013, // iPad Mini Retina (China)
411
- @"iPad4,7": @2014, // iPad Mini 3 (WiFi)
412
- @"iPad4,8": @2014, // iPad Mini 3 (GSM+CDMA)
413
- @"iPad4,9": @2014, // iPad Mini 3 (China)
414
- @"iPad5,1": @2015, // iPad Mini 4 (WiFi)
415
- @"iPad5,2": @2015, // iPad Mini 4 (WiFi+Cellular)
416
- @"iPad5,3": @2014,
417
- @"iPad5,4": @2014,
418
- @"iPad6,7": @2015,
419
- @"iPad6,8": @2015,
420
- @"iPad6,3": @2016,
421
- @"iPad6,4": @2016,
422
- @"iPad6,11": @2017, // iPad 5th Gen (WiFi)
423
- @"iPad6,12": @2017, // iPad 5th Gen (WiFi+Cellular)
424
- @"iPad7,1": @2017, // iPad Pro 2nd Gen (WiFi)
425
- @"iPad7,2": @2017, // iPad Pro 2nd Gen (WiFi+Cellular)
426
- @"iPad7,3": @2017, // iPad Pro 10.5-inch
427
- @"iPad7,4": @2017, // iPad Pro 10.5-inch
428
- @"iPad7,5": @2018, // iPad 6th Gen (WiFi)
429
- @"iPad7,6": @2018, // iPad 6th Gen (WiFi+Cellular)
430
- @"iPad7,11": @2019, // iPad 7th Gen 10.2-inch (WiFi)
431
- @"iPad7,12": @2019, // iPad 7th Gen 10.2-inch (WiFi+Cellular)
432
- @"iPad8,1": @2018, // iPad Pro 3rd Gen (11 inch, WiFi)
433
- @"iPad8,2": @2018, // iPad Pro 3rd Gen (11 inch, 1TB, WiFi)
434
- @"iPad8,3": @2018, // iPad Pro 3rd Gen (11 inch, WiFi+Cellular)
435
- @"iPad8,4": @2018, // iPad Pro 3rd Gen (11 inch, 1TB, WiFi+Cellular)
436
- @"iPad8,5": @2018, // iPad Pro 3rd Gen (12.9 inch, WiFi)
437
- @"iPad8,6": @2018, // iPad Pro 3rd Gen (12.9 inch, 1TB, WiFi)
438
- @"iPad8,7": @2018, // iPad Pro 3rd Gen (12.9 inch, WiFi+Cellular)
439
- @"iPad8,8": @2018, // iPad Pro 3rd Gen (12.9 inch, 1TB, WiFi+Cellular)
440
- @"iPad11,1": @2019, // iPad Mini 5th Gen (WiFi)
441
- @"iPad11,2": @2019, // iPad Mini 5th Gen
442
- @"iPad11,3": @2019, // iPad Air 3rd Gen (WiFi)
443
- @"iPad11,4": @2019, // iPad Air 3rd Gen
444
- @"iPad11,6": @2020, // iPad 8th Gen
445
- @"iPad11,7": @2020, // iPad 8th Gen
446
- @"iPad13,1": @2020, // iPad Air 4th Gen (WiFi)
447
- @"iPad13,2": @2020, // iPad Air 4th Gen (WiFi+Cellular)
448
- @"iPad13,4": @2021, // iPad Pro 11-inch 3rd Gen
449
- @"iPad13,5": @2021, // iPad Pro 11-inch 3rd Gen
450
- @"iPad13,6": @2021, // iPad Pro 11-inch 3rd Gen
451
- @"iPad13,7": @2021, // iPad Pro 11-inch 3rd Gen
452
- @"iPad13,8": @2021, // iPad Pro 12.9-inch 5th Gen
453
- @"iPad13,9": @2021, // iPad Pro 12.9-inch 5th Gen
454
- @"iPad13,10": @2021, // iPad Pro 12.9-inch 5th Gen
455
- @"iPad13,11": @2021, // iPad Pro 12.9-inch 5th Gen
456
- @"iPad14,1": @2021, // iPad mini (6th generation) (WiFi)
457
- @"iPad14,2": @2021 // iPad mini (6th generation) (WiFi + cellular)
458
- };
459
-
460
- NSNumber *deviceYear = mapping[platform];
461
-
462
- if (deviceYear) {
463
- return deviceYear;
464
- }
465
-
466
- // Simulator or unknown - just assume newest device.
467
- NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
468
- [formatter setDateFormat:@"yyyy"];
469
- NSString *yearString = [formatter stringFromDate:[NSDate date]];
470
-
471
- return @([yearString intValue]);
472
- }
473
-
474
162
  + (NSString *)deviceName
475
163
  {
476
164
  return [UIDevice currentDevice].name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-constants",
3
- "version": "14.4.0",
3
+ "version": "14.4.2",
4
4
  "description": "Provides system information that remains constant throughout the lifetime of your app.",
5
5
  "main": "build/Constants.js",
6
6
  "types": "build/Constants.d.ts",
@@ -34,7 +34,7 @@
34
34
  "preset": "expo-module-scripts"
35
35
  },
36
36
  "dependencies": {
37
- "@expo/config": "~8.0.0",
37
+ "@expo/config": "~8.1.0",
38
38
  "uuid": "^3.3.2"
39
39
  },
40
40
  "devDependencies": {
@@ -43,5 +43,5 @@
43
43
  "peerDependencies": {
44
44
  "expo": "*"
45
45
  },
46
- "gitHead": "3ccd2edee9cbfed217557675cb50f0ba5e55a9e4"
46
+ "gitHead": "0efde1d91bcf609c94a9f9b57f47afd9ef315e2d"
47
47
  }
package/src/Constants.ts CHANGED
@@ -74,8 +74,6 @@ if (!rawManifest && ExponentConstants && ExponentConstants.manifest) {
74
74
 
75
75
  const { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;
76
76
 
77
- let warnedAboutDeviceYearClass = false;
78
- let warnedAboutIosModel = false;
79
77
  let warnedAboutManifestField = false;
80
78
 
81
79
  const constants: Constants = {
@@ -85,19 +83,6 @@ const constants: Constants = {
85
83
  };
86
84
 
87
85
  Object.defineProperties(constants, {
88
- // Deprecated field
89
- deviceYearClass: {
90
- get() {
91
- if (!warnedAboutDeviceYearClass) {
92
- console.warn(
93
- `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`
94
- );
95
- warnedAboutDeviceYearClass = true;
96
- }
97
- return nativeConstants.deviceYearClass;
98
- },
99
- enumerable: false,
100
- },
101
86
  installationId: {
102
87
  get() {
103
88
  return nativeConstants.installationId;
@@ -224,23 +209,6 @@ Object.defineProperties(constants, {
224
209
  },
225
210
  });
226
211
 
227
- // Add deprecation warning for `platform.ios.model`
228
- if (constants?.platform?.ios) {
229
- const originalModel = nativeConstants.platform.ios.model;
230
- Object.defineProperty(constants.platform.ios, 'model', {
231
- get() {
232
- if (!warnedAboutIosModel) {
233
- console.warn(
234
- `Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`
235
- );
236
- warnedAboutIosModel = true;
237
- }
238
- return originalModel;
239
- },
240
- enumerable: false,
241
- });
242
- }
243
-
244
212
  function isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {
245
213
  return !isManifest(manifest);
246
214
  }