expo-constants 12.1.3 → 12.2.0
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 +10 -0
- package/android/build.gradle +2 -2
- package/build/Constants.js +85 -71
- package/build/Constants.js.map +1 -1
- package/build/Constants.types.d.ts +119 -28
- package/build/Constants.types.js +16 -0
- package/build/Constants.types.js.map +1 -1
- package/package.json +6 -4
- package/scripts/get-app-config-ios.sh +6 -3
- package/scripts/source-login-scripts.sh +45 -0
- package/src/Constants.ts +93 -82
- package/src/Constants.types.ts +135 -32
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 12.2.0 — 2021-11-17
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fix NODE_BINARY not found build error when using nvm via zsh ([#14895](https://github.com/expo/expo/pull/14895) by [@filipengberg](https://github.com/filipengberg))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Extract nested objects from current types to new, separate types - `ExpoGoPackagerOpts` and `ManifestExtra`. ([#15113](https://github.com/expo/expo/pull/15113) by [@Simek](https://github.com/Simek))
|
|
22
|
+
|
|
13
23
|
## 12.1.3 — 2021-10-22
|
|
14
24
|
|
|
15
25
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '12.
|
|
6
|
+
version = '12.2.0'
|
|
7
7
|
|
|
8
8
|
apply from: "../scripts/get-app-config-android.gradle"
|
|
9
9
|
|
|
@@ -63,7 +63,7 @@ android {
|
|
|
63
63
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
64
64
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
65
65
|
versionCode 33
|
|
66
|
-
versionName "12.
|
|
66
|
+
versionName "12.2.0"
|
|
67
67
|
}
|
|
68
68
|
lintOptions {
|
|
69
69
|
abortOnError false
|
package/build/Constants.js
CHANGED
|
@@ -49,51 +49,49 @@ const constants = {
|
|
|
49
49
|
// Ensure this is null in bare workflow
|
|
50
50
|
appOwnership: appOwnership ?? null,
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
Object.defineProperties(constants, {
|
|
53
53
|
// Deprecated fields
|
|
54
|
-
deviceYearClass
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
deviceYearClass: {
|
|
55
|
+
get() {
|
|
56
|
+
if (!warnedAboutDeviceYearClass) {
|
|
57
|
+
console.warn(`Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`);
|
|
58
|
+
warnedAboutDeviceYearClass = true;
|
|
59
|
+
}
|
|
60
|
+
return nativeConstants.deviceYearClass;
|
|
61
|
+
},
|
|
62
|
+
enumerable: false,
|
|
60
63
|
},
|
|
61
64
|
// Deprecated fields
|
|
62
|
-
installationId
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
installationId: {
|
|
66
|
+
get() {
|
|
67
|
+
if (!warnedAboutInstallationId) {
|
|
68
|
+
console.warn(`Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`);
|
|
69
|
+
warnedAboutInstallationId = true;
|
|
70
|
+
}
|
|
71
|
+
return nativeConstants.installationId;
|
|
72
|
+
},
|
|
73
|
+
enumerable: false,
|
|
68
74
|
},
|
|
69
75
|
// Legacy aliases
|
|
70
|
-
deviceId
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
console.warn(`Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`);
|
|
80
|
-
warnedAboutLinkingUrl = true;
|
|
81
|
-
}
|
|
82
|
-
return nativeConstants.linkingUri;
|
|
83
|
-
},
|
|
84
|
-
manifest() {
|
|
85
|
-
const maybeManifest = getManifest();
|
|
86
|
-
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
return maybeManifest;
|
|
76
|
+
deviceId: {
|
|
77
|
+
get() {
|
|
78
|
+
if (!warnedAboutDeviceId) {
|
|
79
|
+
console.warn(`Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`);
|
|
80
|
+
warnedAboutDeviceId = true;
|
|
81
|
+
}
|
|
82
|
+
return nativeConstants.installationId;
|
|
83
|
+
},
|
|
84
|
+
enumerable: false,
|
|
90
85
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
linkingUrl: {
|
|
87
|
+
get() {
|
|
88
|
+
if (!warnedAboutLinkingUrl) {
|
|
89
|
+
console.warn(`Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`);
|
|
90
|
+
warnedAboutLinkingUrl = true;
|
|
91
|
+
}
|
|
92
|
+
return nativeConstants.linkingUri;
|
|
93
|
+
},
|
|
94
|
+
enumerable: false,
|
|
97
95
|
},
|
|
98
96
|
/**
|
|
99
97
|
* Use `manifest` property by default.
|
|
@@ -101,54 +99,70 @@ const constantsPropertiesGetter = {
|
|
|
101
99
|
* It behaves similarly to the original one, but suppresses warning upon no manifest available.
|
|
102
100
|
* `expo-asset` uses it to prevent users from seeing mentioned warning.
|
|
103
101
|
*/
|
|
104
|
-
__unsafeNoWarnManifest
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
__unsafeNoWarnManifest: {
|
|
103
|
+
get() {
|
|
104
|
+
const maybeManifest = getManifest(true);
|
|
105
|
+
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return maybeManifest;
|
|
109
|
+
},
|
|
110
|
+
enumerable: false,
|
|
110
111
|
},
|
|
111
|
-
__unsafeNoWarnManifest2
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
__unsafeNoWarnManifest2: {
|
|
113
|
+
get() {
|
|
114
|
+
const maybeManifest = getManifest(true);
|
|
115
|
+
if (!maybeManifest || !isManifest(maybeManifest)) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return maybeManifest;
|
|
119
|
+
},
|
|
120
|
+
enumerable: false,
|
|
117
121
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
manifest: {
|
|
123
|
+
get() {
|
|
124
|
+
const maybeManifest = getManifest();
|
|
125
|
+
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return maybeManifest;
|
|
129
|
+
},
|
|
130
|
+
enumerable: true,
|
|
131
|
+
},
|
|
132
|
+
manifest2: {
|
|
133
|
+
get() {
|
|
134
|
+
const maybeManifest = getManifest();
|
|
135
|
+
if (!maybeManifest || !isManifest(maybeManifest)) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return maybeManifest;
|
|
139
|
+
},
|
|
140
|
+
enumerable: true,
|
|
123
141
|
},
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
__rawManifest_TEST: {
|
|
143
|
+
get() {
|
|
144
|
+
return rawManifest;
|
|
145
|
+
},
|
|
146
|
+
set(value) {
|
|
147
|
+
rawManifest = value;
|
|
148
|
+
},
|
|
149
|
+
enumerable: false,
|
|
126
150
|
},
|
|
127
|
-
// Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
|
|
128
|
-
enumerable: false,
|
|
129
151
|
});
|
|
130
152
|
// Add deprecation warning for `platform.ios.model`
|
|
131
153
|
if (constants?.platform?.ios) {
|
|
132
154
|
const originalModel = nativeConstants.platform.ios.model;
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
Object.defineProperty(constants.platform.ios, 'model', {
|
|
156
|
+
get() {
|
|
135
157
|
if (!warnedAboutIosModel) {
|
|
136
158
|
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.`);
|
|
137
159
|
warnedAboutIosModel = true;
|
|
138
160
|
}
|
|
139
161
|
return originalModel;
|
|
140
162
|
},
|
|
163
|
+
enumerable: false,
|
|
141
164
|
});
|
|
142
165
|
}
|
|
143
|
-
function definePropertiesGetter(target, props) {
|
|
144
|
-
for (const [name, func] of Object.entries(props)) {
|
|
145
|
-
Object.defineProperty(target, name, {
|
|
146
|
-
get: func,
|
|
147
|
-
// Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
|
|
148
|
-
enumerable: false,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
166
|
function isAppManifest(manifest) {
|
|
153
167
|
return !isManifest(manifest);
|
|
154
168
|
}
|
package/build/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAGL,YAAY,EAEZ,oBAAoB,EAKpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,C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nE,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 { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\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 warnedAboutInstallationId = false;\nlet warnedAboutDeviceId = false;\nlet warnedAboutLinkingUrl = false;\n\nconst constants: Constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n};\n\nconst constantsPropertiesGetter: AccessorProps = {\n // Deprecated fields\n deviceYearClass() {\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 // Deprecated fields\n installationId() {\n if (!warnedAboutInstallationId) {\n console.warn(\n `Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`\n );\n warnedAboutInstallationId = true;\n }\n return nativeConstants.installationId;\n },\n // Legacy aliases\n deviceId() {\n if (!warnedAboutDeviceId) {\n console.warn(\n `Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`\n );\n warnedAboutDeviceId = true;\n }\n return nativeConstants.installationId;\n },\n linkingUrl() {\n if (!warnedAboutLinkingUrl) {\n console.warn(\n `Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`\n );\n warnedAboutLinkingUrl = true;\n }\n return nativeConstants.linkingUri;\n },\n manifest(): AppManifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n manifest2(): Manifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\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(): AppManifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n __unsafeNoWarnManifest2(): Manifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n};\ndefinePropertiesGetter(constants, constantsPropertiesGetter);\n\nObject.defineProperty(constants, '__rawManifest_TEST', {\n get(): AppManifest | Manifest | null {\n return rawManifest;\n },\n set(value: AppManifest | Manifest | null) {\n rawManifest = value;\n },\n // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.\n enumerable: false,\n});\n\n// Add deprecation warning for `platform.ios.model`\nif (constants?.platform?.ios) {\n const originalModel = nativeConstants.platform.ios.model;\n definePropertiesGetter(constants.platform.ios, {\n model() {\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 });\n}\n\ntype AccessorProps = Record<string, () => any>;\nfunction definePropertiesGetter(target: object, props: AccessorProps) {\n for (const [name, func] of Object.entries(props)) {\n Object.defineProperty(target, name, {\n get: func,\n // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.\n enumerable: false,\n });\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"]}
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAGL,YAAY,EAEZ,oBAAoB,EAKpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAEL,YAAY,EAEZ,oBAAoB,EAIpB,kBAAkB,GAEnB,CAAC;AAEF,IAAI,CAAC,iBAAiB,EAAE;IACtB,OAAO,CAAC,IAAI,CACV,wGAAwG,CACzG,CAAC;CACH;AAED,IAAI,WAAW,GAAkC,IAAI,CAAC;AACtD,gEAAgE;AAChE,IAAI,kBAAkB,CAAC,WAAW,EAAE;IAClC,IAAI,eAAe,CAAC;IACpB,IAAI,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE;QAC3C,eAAe,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC;KAC3D;SAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,cAAc,EAAE;QACxD,eAAe,GAAG,IA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GAAG,IAAI,CAAC;aAC5B;YACD,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;CACJ;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 { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\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 warnedAboutInstallationId = false;\nlet warnedAboutDeviceId = false;\nlet warnedAboutLinkingUrl = 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 fields\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 // Deprecated fields\n installationId: {\n get() {\n if (!warnedAboutInstallationId) {\n console.warn(\n `Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`\n );\n warnedAboutInstallationId = true;\n }\n return nativeConstants.installationId;\n },\n enumerable: false,\n },\n // Legacy aliases\n deviceId: {\n get() {\n if (!warnedAboutDeviceId) {\n console.warn(\n `Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`\n );\n warnedAboutDeviceId = true;\n }\n return nativeConstants.installationId;\n },\n enumerable: false,\n },\n linkingUrl: {\n get() {\n if (!warnedAboutLinkingUrl) {\n console.warn(\n `Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`\n );\n warnedAboutLinkingUrl = true;\n }\n return nativeConstants.linkingUri;\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 | 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 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 __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"]}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config-types';
|
|
2
2
|
export declare enum AppOwnership {
|
|
3
|
+
/**
|
|
4
|
+
* It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
|
|
5
|
+
*/
|
|
3
6
|
Standalone = "standalone",
|
|
7
|
+
/**
|
|
8
|
+
* The experience is running inside of the Expo Go app.
|
|
9
|
+
*/
|
|
4
10
|
Expo = "expo",
|
|
11
|
+
/**
|
|
12
|
+
* It has been opened through a link from a standalone app.
|
|
13
|
+
*/
|
|
5
14
|
Guest = "guest"
|
|
6
15
|
}
|
|
7
16
|
export declare enum ExecutionEnvironment {
|
|
@@ -9,23 +18,53 @@ export declare enum ExecutionEnvironment {
|
|
|
9
18
|
Standalone = "standalone",
|
|
10
19
|
StoreClient = "storeClient"
|
|
11
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
|
|
23
|
+
* as `unsupported`.
|
|
24
|
+
*/
|
|
12
25
|
export declare enum UserInterfaceIdiom {
|
|
13
26
|
Handset = "handset",
|
|
14
27
|
Tablet = "tablet",
|
|
15
28
|
Unsupported = "unsupported"
|
|
16
29
|
}
|
|
17
30
|
export interface IOSManifest {
|
|
31
|
+
/**
|
|
32
|
+
* The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.
|
|
33
|
+
* In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This
|
|
34
|
+
* may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest
|
|
35
|
+
* can be updated, whereas this value will never change for a given native binary.
|
|
36
|
+
* The value is set to `null` in case you run your app in Expo Go.
|
|
37
|
+
*/
|
|
18
38
|
buildNumber: string;
|
|
39
|
+
/**
|
|
40
|
+
* The Apple internal model identifier for this device, e.g. `iPhone1,1`.
|
|
41
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).
|
|
42
|
+
*/
|
|
19
43
|
platform: string;
|
|
20
44
|
/**
|
|
21
|
-
*
|
|
45
|
+
* The human-readable model name of this device, e.g. `"iPhone 7 Plus"` if it can be determined,
|
|
46
|
+
* otherwise will be `null`.
|
|
47
|
+
* @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).
|
|
22
48
|
*/
|
|
23
49
|
model: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.
|
|
52
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).
|
|
53
|
+
*/
|
|
24
54
|
userInterfaceIdiom: UserInterfaceIdiom;
|
|
55
|
+
/**
|
|
56
|
+
* The version of iOS running on this device, e.g. `10.3`.
|
|
57
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).
|
|
58
|
+
*/
|
|
25
59
|
systemVersion: string;
|
|
26
60
|
[key: string]: any;
|
|
27
61
|
}
|
|
28
62
|
export interface AndroidManifest {
|
|
63
|
+
/**
|
|
64
|
+
* The version code set by `android.versionCode` in app.json.
|
|
65
|
+
* The value is set to `null` in case you run your app in Expo Go.
|
|
66
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
|
|
67
|
+
*/
|
|
29
68
|
versionCode: number;
|
|
30
69
|
[key: string]: any;
|
|
31
70
|
}
|
|
@@ -45,16 +84,17 @@ export declare type Manifest = {
|
|
|
45
84
|
launchAsset: ManifestAsset;
|
|
46
85
|
assets: ManifestAsset[];
|
|
47
86
|
metadata: object;
|
|
48
|
-
extra?:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
87
|
+
extra?: ManifestExtra;
|
|
88
|
+
};
|
|
89
|
+
export declare type ManifestExtra = ClientScopingConfig & {
|
|
90
|
+
expoClient?: ExpoClientConfig;
|
|
91
|
+
expoGo?: ExpoGoConfig;
|
|
92
|
+
eas?: EASConfig;
|
|
53
93
|
};
|
|
54
94
|
export declare type EASConfig = {
|
|
55
95
|
/**
|
|
56
|
-
* The ID for this project if it's using EAS. UUID. This value will not change when a project is
|
|
57
|
-
* between accounts or renamed.
|
|
96
|
+
* The ID for this project if it's using EAS. UUID. This value will not change when a project is
|
|
97
|
+
* transferred between accounts or renamed.
|
|
58
98
|
*/
|
|
59
99
|
projectId?: string;
|
|
60
100
|
};
|
|
@@ -73,19 +113,22 @@ export declare type ExpoGoConfig = {
|
|
|
73
113
|
tool?: string;
|
|
74
114
|
[key: string]: any;
|
|
75
115
|
};
|
|
76
|
-
packagerOpts?:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
packagerOpts?: ExpoGoPackagerOpts;
|
|
117
|
+
};
|
|
118
|
+
export declare type ExpoGoPackagerOpts = {
|
|
119
|
+
hostType?: string;
|
|
120
|
+
dev?: boolean;
|
|
121
|
+
strict?: boolean;
|
|
122
|
+
minify?: boolean;
|
|
123
|
+
urlType?: string;
|
|
124
|
+
urlRandomness?: string;
|
|
125
|
+
lanType?: string;
|
|
126
|
+
[key: string]: any;
|
|
86
127
|
};
|
|
87
128
|
export declare type ExpoClientConfig = ExpoConfig & {
|
|
88
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Published apps only.
|
|
131
|
+
*/
|
|
89
132
|
releaseId?: string;
|
|
90
133
|
revisionId?: string;
|
|
91
134
|
releaseChannel?: string;
|
|
@@ -94,8 +137,8 @@ export declare type ExpoClientConfig = ExpoConfig & {
|
|
|
94
137
|
publishedTime?: string;
|
|
95
138
|
/**
|
|
96
139
|
* The Expo account name and slug for this project.
|
|
97
|
-
* @deprecated
|
|
98
|
-
* scoping due to immutability.
|
|
140
|
+
* @deprecated Prefer `projectId` or `originalFullName` instead for identification and
|
|
141
|
+
* `scopeKey` for scoping due to immutability.
|
|
99
142
|
*/
|
|
100
143
|
id?: string;
|
|
101
144
|
/**
|
|
@@ -112,6 +155,7 @@ export declare type ExpoClientConfig = ExpoConfig & {
|
|
|
112
155
|
currentFullName?: string;
|
|
113
156
|
};
|
|
114
157
|
/**
|
|
158
|
+
* @hidden
|
|
115
159
|
* A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest
|
|
116
160
|
*/
|
|
117
161
|
export declare type AppManifest = ExpoClientConfig & ExpoGoConfig & EASConfig & ClientScopingConfig & {
|
|
@@ -131,34 +175,63 @@ export interface PlatformManifest {
|
|
|
131
175
|
developer?: string;
|
|
132
176
|
[key: string]: any;
|
|
133
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* @hidden
|
|
180
|
+
*/
|
|
134
181
|
export interface NativeConstants {
|
|
135
182
|
name: 'ExponentConstants';
|
|
183
|
+
/**
|
|
184
|
+
* Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow
|
|
185
|
+
* and classic builds; for apps built with EAS Build and in bare workflow, the result is
|
|
186
|
+
* always `null`.
|
|
187
|
+
*/
|
|
136
188
|
appOwnership: AppOwnership | null;
|
|
137
189
|
debugMode: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* A human-readable name for the device type.
|
|
192
|
+
*/
|
|
138
193
|
deviceName?: string;
|
|
139
194
|
/**
|
|
140
|
-
*
|
|
195
|
+
* The [device year class](https://github.com/facebook/device-year-class) of this device.
|
|
196
|
+
* @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).
|
|
141
197
|
*/
|
|
142
198
|
deviceYearClass: number | null;
|
|
143
199
|
executionEnvironment: ExecutionEnvironment;
|
|
144
200
|
experienceUrl: string;
|
|
145
201
|
expoRuntimeVersion: string | null;
|
|
146
202
|
/**
|
|
147
|
-
* The version string of the Expo
|
|
203
|
+
* The version string of the Expo Go app currently running.
|
|
148
204
|
* Returns `null` in bare workflow and web.
|
|
149
205
|
*/
|
|
150
206
|
expoVersion: string | null;
|
|
151
207
|
isDetached?: boolean;
|
|
152
208
|
intentUri?: string;
|
|
153
209
|
/**
|
|
154
|
-
*
|
|
210
|
+
* An identifier that is unique to this particular device and whose lifetime is at least as long
|
|
211
|
+
* as the installation of the app.
|
|
212
|
+
* @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and
|
|
155
213
|
* storing it. This API will be removed in SDK 44.
|
|
156
214
|
*/
|
|
157
215
|
installationId: string;
|
|
216
|
+
/**
|
|
217
|
+
* `true` if the app is running on a device, `false` if running in a simulator or emulator.
|
|
218
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).
|
|
219
|
+
*/
|
|
158
220
|
isDevice: boolean;
|
|
159
221
|
isHeadless: boolean;
|
|
160
222
|
linkingUri: string;
|
|
223
|
+
/**
|
|
224
|
+
* The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set
|
|
225
|
+
* by `version` in app.json on Android at the time the native app was built.
|
|
226
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).
|
|
227
|
+
*/
|
|
161
228
|
nativeAppVersion: string | null;
|
|
229
|
+
/**
|
|
230
|
+
* The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in
|
|
231
|
+
* **app.json** in a standalone app) and the version code set by `android.versionCode` in
|
|
232
|
+
* **app.json** on Android at the time the native app was built.
|
|
233
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
|
|
234
|
+
*/
|
|
162
235
|
nativeBuildVersion: string | null;
|
|
163
236
|
/**
|
|
164
237
|
* Classic manifest for Expo apps using classic updates.
|
|
@@ -170,26 +243,43 @@ export interface NativeConstants {
|
|
|
170
243
|
* Returns `null` in bare workflow and when `manifest` is non-null.
|
|
171
244
|
*/
|
|
172
245
|
manifest2: Manifest | null;
|
|
246
|
+
/**
|
|
247
|
+
* A string that is unique to the current session of your app. It is different across apps and
|
|
248
|
+
* across multiple launches of the same app.
|
|
249
|
+
*/
|
|
173
250
|
sessionId: string;
|
|
251
|
+
/**
|
|
252
|
+
* The default status bar height for the device. Does not factor in changes when location tracking
|
|
253
|
+
* is in use or a phone call is active.
|
|
254
|
+
*/
|
|
174
255
|
statusBarHeight: number;
|
|
256
|
+
/**
|
|
257
|
+
* A list of the system font names available on the current device.
|
|
258
|
+
*/
|
|
175
259
|
systemFonts: string[];
|
|
176
260
|
systemVersion?: number;
|
|
177
261
|
platform?: PlatformManifest;
|
|
178
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Gets the user agent string which would be included in requests sent by a web view running on
|
|
264
|
+
* this device. This is probably not the same user agent you might be providing in your JS `fetch`
|
|
265
|
+
* requests.
|
|
266
|
+
*/
|
|
179
267
|
getWebViewUserAgentAsync: () => Promise<string | null>;
|
|
268
|
+
[key: string]: any;
|
|
180
269
|
}
|
|
181
270
|
export interface Constants extends NativeConstants {
|
|
182
271
|
/**
|
|
183
|
-
* @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.
|
|
272
|
+
* @deprecated `Constants.deviceId` is deprecated in favor of generating your own ID and storing it.
|
|
184
273
|
* This API will be removed in SDK 44.
|
|
185
274
|
*/
|
|
186
275
|
deviceId?: string;
|
|
187
276
|
/**
|
|
188
|
-
* @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri
|
|
189
|
-
* Linking API directly. Constants.linkingUrl will be removed in SDK 44.
|
|
277
|
+
* @deprecated `Constants.linkingUrl` has been renamed to `Constants.linkingUri`. Consider using the
|
|
278
|
+
* Linking API directly. `Constants.linkingUrl` will be removed in SDK 44.
|
|
190
279
|
*/
|
|
191
280
|
linkingUrl?: string;
|
|
192
281
|
/**
|
|
282
|
+
* @hidden
|
|
193
283
|
* @warning do not use this property. Use `manifest` by default.
|
|
194
284
|
*
|
|
195
285
|
* In certain cases accessing manifest via this property
|
|
@@ -197,6 +287,7 @@ export interface Constants extends NativeConstants {
|
|
|
197
287
|
*/
|
|
198
288
|
__unsafeNoWarnManifest?: AppManifest;
|
|
199
289
|
/**
|
|
290
|
+
* @hidden
|
|
200
291
|
* @warning do not use this property. Use `manifest2` by default.
|
|
201
292
|
*
|
|
202
293
|
* In certain cases accessing manifest via this property
|
package/build/Constants.types.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
// @needsAudit
|
|
1
2
|
export var AppOwnership;
|
|
2
3
|
(function (AppOwnership) {
|
|
4
|
+
/**
|
|
5
|
+
* It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
|
|
6
|
+
*/
|
|
3
7
|
AppOwnership["Standalone"] = "standalone";
|
|
8
|
+
/**
|
|
9
|
+
* The experience is running inside of the Expo Go app.
|
|
10
|
+
*/
|
|
4
11
|
AppOwnership["Expo"] = "expo";
|
|
12
|
+
/**
|
|
13
|
+
* It has been opened through a link from a standalone app.
|
|
14
|
+
*/
|
|
5
15
|
AppOwnership["Guest"] = "guest";
|
|
6
16
|
})(AppOwnership || (AppOwnership = {}));
|
|
17
|
+
// @docsMissing
|
|
7
18
|
export var ExecutionEnvironment;
|
|
8
19
|
(function (ExecutionEnvironment) {
|
|
9
20
|
ExecutionEnvironment["Bare"] = "bare";
|
|
10
21
|
ExecutionEnvironment["Standalone"] = "standalone";
|
|
11
22
|
ExecutionEnvironment["StoreClient"] = "storeClient";
|
|
12
23
|
})(ExecutionEnvironment || (ExecutionEnvironment = {}));
|
|
24
|
+
// @needsAudit
|
|
25
|
+
/**
|
|
26
|
+
* Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
|
|
27
|
+
* as `unsupported`.
|
|
28
|
+
*/
|
|
13
29
|
export var UserInterfaceIdiom;
|
|
14
30
|
(function (UserInterfaceIdiom) {
|
|
15
31
|
UserInterfaceIdiom["Handset"] = "handset";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.types.js","sourceRoot":"","sources":["../src/Constants.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,iDAAyB,CAAA;IACzB,mDAA2B,CAAA;AAC7B,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;AAC7B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport enum AppOwnership {\n Standalone = 'standalone',\n Expo = 'expo',\n Guest = 'guest',\n}\n\nexport enum ExecutionEnvironment {\n Bare = 'bare',\n Standalone = 'standalone',\n StoreClient = 'storeClient',\n}\n\nexport enum UserInterfaceIdiom {\n Handset = 'handset',\n Tablet = 'tablet',\n Unsupported = 'unsupported',\n}\n\nexport interface IOSManifest {\n buildNumber: string;\n platform: string;\n /**\n * @deprecated Moved to `expo-device` - `Device.modelName`\n */\n model: string | null;\n userInterfaceIdiom: UserInterfaceIdiom;\n systemVersion: string;\n [key: string]: any;\n}\n\nexport interface AndroidManifest {\n versionCode: number;\n [key: string]: any;\n}\n\nexport interface WebManifest {\n [key: string]: any;\n}\n\nexport interface ManifestAsset {\n url: string;\n}\n\n/**\n * A modern manifest.\n */\nexport type Manifest = {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ManifestAsset;\n assets: ManifestAsset[];\n metadata: object;\n extra?: ClientScopingConfig & {\n expoClient?: ExpoClientConfig;\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n };\n};\n\nexport type EASConfig = {\n /**\n * The ID for this project if it's using EAS. UUID. This value will not change when a project is transferred\n * between accounts or renamed.\n */\n projectId?: string;\n};\n\nexport type ClientScopingConfig = {\n /**\n * An opaque unique string for scoping client-side data to this project. This value\n * will not change when a project is transferred between accounts or renamed.\n */\n scopeKey?: string;\n};\n\nexport type ExpoGoConfig = {\n mainModuleName?: string;\n debuggerHost?: string;\n logUrl?: string;\n developer?: {\n tool?: string;\n [key: string]: any;\n };\n packagerOpts?: {\n hostType?: string;\n dev?: boolean;\n strict?: boolean;\n minify?: boolean;\n urlType?: string;\n urlRandomness?: string;\n lanType?: string;\n [key: string]: any;\n };\n};\n\nexport type ExpoClientConfig = ExpoConfig & {\n /** Published Apps Only */\n releaseId?: string;\n revisionId?: string;\n releaseChannel?: string;\n bundleUrl: string;\n hostUri?: string;\n publishedTime?: string;\n\n /**\n * The Expo account name and slug for this project.\n * @deprecated - Prefer `projectId` or `originalFullName` instead for identification and `scopeKey` for\n * scoping due to immutability.\n */\n id?: string;\n\n /**\n * The original Expo account name and slug for this project. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * will not change when a project is transferred between accounts or renamed.\n */\n originalFullName?: string;\n\n /**\n * The Expo account name and slug used for display purposes. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * may change when a project is transferred between accounts or renamed.\n */\n currentFullName?: string;\n};\n\n/**\n * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest\n */\nexport type AppManifest = ExpoClientConfig &\n ExpoGoConfig &\n EASConfig &\n ClientScopingConfig & {\n [key: string]: any;\n };\n\nexport interface PlatformManifest {\n ios?: IOSManifest;\n android?: AndroidManifest;\n web?: WebManifest;\n detach?: {\n scheme?: string;\n [key: string]: any;\n };\n logUrl?: string;\n scheme?: string;\n hostUri?: string;\n developer?: string;\n [key: string]: any;\n}\n\nexport interface NativeConstants {\n name: 'ExponentConstants';\n appOwnership: AppOwnership | null;\n debugMode: boolean;\n deviceName?: string;\n /**\n * @deprecated Moved to `expo-device` - `Device.deviceYearClass`\n */\n deviceYearClass: number | null;\n executionEnvironment: ExecutionEnvironment;\n experienceUrl: string;\n // only nullable on web\n expoRuntimeVersion: string | null;\n /**\n * The version string of the Expo client currently running.\n * Returns `null` in bare workflow and web.\n */\n expoVersion: string | null;\n isDetached?: boolean;\n intentUri?: string;\n /**\n * @deprecated Constants.installationId is deprecated in favor of generating your own ID and\n * storing it. This API will be removed in SDK 44.\n */\n installationId: string;\n isDevice: boolean;\n isHeadless: boolean;\n linkingUri: string;\n nativeAppVersion: string | null;\n nativeBuildVersion: string | null;\n /**\n * Classic manifest for Expo apps using classic updates.\n * Returns `null` in bare workflow and when `manifest2` is non-null.\n */\n manifest: AppManifest | null;\n /**\n * New manifest for Expo apps using modern Expo Updates.\n * Returns `null` in bare workflow and when `manifest` is non-null.\n */\n manifest2: Manifest | null;\n sessionId: string;\n statusBarHeight: number;\n systemFonts: string[];\n systemVersion?: number;\n platform?: PlatformManifest;\n [key: string]: any;\n\n getWebViewUserAgentAsync: () => Promise<string | null>;\n}\n\nexport interface Constants extends NativeConstants {\n /**\n * @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.\n * This API will be removed in SDK 44.\n */\n deviceId?: string;\n /**\n * @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the\n * Linking API directly. Constants.linkingUrl will be removed in SDK 44.\n */\n linkingUrl?: string;\n /**\n * @warning do not use this property. Use `manifest` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest?: AppManifest;\n /**\n * @warning do not use this property. Use `manifest2` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest2?: Manifest;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Constants.types.js","sourceRoot":"","sources":["../src/Constants.types.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,CAAN,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB;;OAEG;IACH,yCAAyB,CAAA;IACzB;;OAEG;IACH,6BAAa,CAAA;IACb;;OAEG;IACH,+BAAe,CAAA;AACjB,CAAC,EAbW,YAAY,KAAZ,YAAY,QAavB;AAED,eAAe;AACf,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,iDAAyB,CAAA;IACzB,mDAA2B,CAAA;AAC7B,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,cAAc;AACd;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;AAC7B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\n// @needsAudit\nexport enum AppOwnership {\n /**\n * It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).\n */\n Standalone = 'standalone',\n /**\n * The experience is running inside of the Expo Go app.\n */\n Expo = 'expo',\n /**\n * It has been opened through a link from a standalone app.\n */\n Guest = 'guest',\n}\n\n// @docsMissing\nexport enum ExecutionEnvironment {\n Bare = 'bare',\n Standalone = 'standalone',\n StoreClient = 'storeClient',\n}\n\n// @needsAudit\n/**\n * Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up\n * as `unsupported`.\n */\nexport enum UserInterfaceIdiom {\n Handset = 'handset',\n Tablet = 'tablet',\n Unsupported = 'unsupported',\n}\n\n// @needsAudit\nexport interface IOSManifest {\n /**\n * The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.\n * In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This\n * may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest\n * can be updated, whereas this value will never change for a given native binary.\n * The value is set to `null` in case you run your app in Expo Go.\n */\n buildNumber: string;\n /**\n * The Apple internal model identifier for this device, e.g. `iPhone1,1`.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).\n */\n platform: string;\n /**\n * The human-readable model name of this device, e.g. `\"iPhone 7 Plus\"` if it can be determined,\n * otherwise will be `null`.\n * @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).\n */\n model: string | null;\n /**\n * The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).\n */\n userInterfaceIdiom: UserInterfaceIdiom;\n /**\n * The version of iOS running on this device, e.g. `10.3`.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).\n */\n systemVersion: string;\n [key: string]: any;\n}\n\n// @needsAudit\nexport interface AndroidManifest {\n /**\n * The version code set by `android.versionCode` in app.json.\n * The value is set to `null` in case you run your app in Expo Go.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).\n */\n versionCode: number;\n [key: string]: any;\n}\n\nexport interface WebManifest {\n [key: string]: any;\n}\n\n// @docsMissing\nexport interface ManifestAsset {\n url: string;\n}\n\n// @needsAudit @docsMissing\n/**\n * A modern manifest.\n */\nexport type Manifest = {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ManifestAsset;\n assets: ManifestAsset[];\n metadata: object;\n extra?: ManifestExtra;\n};\n\n// @docsMissing\nexport type ManifestExtra = ClientScopingConfig & {\n expoClient?: ExpoClientConfig;\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n};\n\n// @needsAudit\nexport type EASConfig = {\n /**\n * The ID for this project if it's using EAS. UUID. This value will not change when a project is\n * transferred between accounts or renamed.\n */\n projectId?: string;\n};\n\n// @needsAudit\nexport type ClientScopingConfig = {\n /**\n * An opaque unique string for scoping client-side data to this project. This value\n * will not change when a project is transferred between accounts or renamed.\n */\n scopeKey?: string;\n};\n\n// @docsMissing\nexport type ExpoGoConfig = {\n mainModuleName?: string;\n debuggerHost?: string;\n logUrl?: string;\n developer?: {\n tool?: string;\n [key: string]: any;\n };\n packagerOpts?: ExpoGoPackagerOpts;\n};\n\n// @docsMissing\nexport type ExpoGoPackagerOpts = {\n hostType?: string;\n dev?: boolean;\n strict?: boolean;\n minify?: boolean;\n urlType?: string;\n urlRandomness?: string;\n lanType?: string;\n [key: string]: any;\n};\n\nexport type ExpoClientConfig = ExpoConfig & {\n /**\n * Published apps only.\n */\n releaseId?: string;\n revisionId?: string;\n releaseChannel?: string;\n bundleUrl: string;\n hostUri?: string;\n publishedTime?: string;\n /**\n * The Expo account name and slug for this project.\n * @deprecated Prefer `projectId` or `originalFullName` instead for identification and\n * `scopeKey` for scoping due to immutability.\n */\n id?: string;\n /**\n * The original Expo account name and slug for this project. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * will not change when a project is transferred between accounts or renamed.\n */\n originalFullName?: string;\n /**\n * The Expo account name and slug used for display purposes. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * may change when a project is transferred between accounts or renamed.\n */\n currentFullName?: string;\n};\n\n/**\n * @hidden\n * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest\n */\nexport type AppManifest = ExpoClientConfig &\n ExpoGoConfig &\n EASConfig &\n ClientScopingConfig & {\n [key: string]: any;\n };\n\n// @needsAudit @docsMissing\nexport interface PlatformManifest {\n ios?: IOSManifest;\n android?: AndroidManifest;\n web?: WebManifest;\n detach?: {\n scheme?: string;\n [key: string]: any;\n };\n logUrl?: string;\n scheme?: string;\n hostUri?: string;\n developer?: string;\n [key: string]: any;\n}\n\n// @needsAudit @docsMissing\n/**\n * @hidden\n */\nexport interface NativeConstants {\n name: 'ExponentConstants';\n /**\n * Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow\n * and classic builds; for apps built with EAS Build and in bare workflow, the result is\n * always `null`.\n */\n appOwnership: AppOwnership | null;\n debugMode: boolean;\n /**\n * A human-readable name for the device type.\n */\n deviceName?: string;\n /**\n * The [device year class](https://github.com/facebook/device-year-class) of this device.\n * @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).\n */\n deviceYearClass: number | null;\n executionEnvironment: ExecutionEnvironment;\n experienceUrl: string;\n // only nullable on web\n expoRuntimeVersion: string | null;\n /**\n * The version string of the Expo Go app currently running.\n * Returns `null` in bare workflow and web.\n */\n expoVersion: string | null;\n isDetached?: boolean;\n intentUri?: string;\n /**\n * An identifier that is unique to this particular device and whose lifetime is at least as long\n * as the installation of the app.\n * @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and\n * storing it. This API will be removed in SDK 44.\n */\n installationId: string;\n /**\n * `true` if the app is running on a device, `false` if running in a simulator or emulator.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).\n */\n isDevice: boolean;\n isHeadless: boolean;\n linkingUri: string;\n /**\n * The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set\n * by `version` in app.json on Android at the time the native app was built.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).\n */\n nativeAppVersion: string | null;\n /**\n * The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in\n * **app.json** in a standalone app) and the version code set by `android.versionCode` in\n * **app.json** on Android at the time the native app was built.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).\n */\n nativeBuildVersion: string | null;\n /**\n * Classic manifest for Expo apps using classic updates.\n * Returns `null` in bare workflow and when `manifest2` is non-null.\n */\n manifest: AppManifest | null;\n /**\n * New manifest for Expo apps using modern Expo Updates.\n * Returns `null` in bare workflow and when `manifest` is non-null.\n */\n manifest2: Manifest | null;\n /**\n * A string that is unique to the current session of your app. It is different across apps and\n * across multiple launches of the same app.\n */\n sessionId: string;\n /**\n * The default status bar height for the device. Does not factor in changes when location tracking\n * is in use or a phone call is active.\n */\n statusBarHeight: number;\n /**\n * A list of the system font names available on the current device.\n */\n systemFonts: string[];\n systemVersion?: number;\n platform?: PlatformManifest;\n /**\n * Gets the user agent string which would be included in requests sent by a web view running on\n * this device. This is probably not the same user agent you might be providing in your JS `fetch`\n * requests.\n */\n getWebViewUserAgentAsync: () => Promise<string | null>;\n [key: string]: any;\n}\n\nexport interface Constants extends NativeConstants {\n /**\n * @deprecated `Constants.deviceId` is deprecated in favor of generating your own ID and storing it.\n * This API will be removed in SDK 44.\n */\n deviceId?: string;\n /**\n * @deprecated `Constants.linkingUrl` has been renamed to `Constants.linkingUri`. Consider using the\n * Linking API directly. `Constants.linkingUrl` will be removed in SDK 44.\n */\n linkingUrl?: string;\n /**\n * @hidden\n * @warning do not use this property. Use `manifest` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest?: AppManifest;\n /**\n * @hidden\n * @warning do not use this property. Use `manifest2` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest2?: Manifest;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-constants",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
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,12 +34,14 @@
|
|
|
34
34
|
"preset": "expo-module-scripts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@expo/config": "^
|
|
38
|
-
"expo-modules-core": "~0.4.4",
|
|
37
|
+
"@expo/config": "^6.0.6",
|
|
39
38
|
"uuid": "^3.3.2"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"expo-module-scripts": "^2.0.0"
|
|
43
42
|
},
|
|
44
|
-
"
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"expo": "*"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "9faa58818454ba59dbff95077b9025a1c1cbd9fd"
|
|
45
47
|
}
|
|
@@ -4,6 +4,12 @@ set -eo pipefail
|
|
|
4
4
|
|
|
5
5
|
DEST="$CONFIGURATION_BUILD_DIR"
|
|
6
6
|
RESOURCE_BUNDLE_NAME="EXConstants.bundle"
|
|
7
|
+
# ref: https://github.com/facebook/react-native/blob/c974cbff04a8d90ac0f856dbada3fc5a75c75b49/scripts/react-native-xcode.sh#L59-L65
|
|
8
|
+
# Path to expo-constants folder inside node_modules
|
|
9
|
+
EXPO_CONSTANTS_PACKAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
+
|
|
11
|
+
source "$EXPO_CONSTANTS_PACKAGE_DIR/scripts/source-login-scripts.sh"
|
|
12
|
+
|
|
7
13
|
NODE_BINARY=${NODE_BINARY:-node}
|
|
8
14
|
|
|
9
15
|
if ! [ -x "$(command -v "$NODE_BINARY")" ]; then
|
|
@@ -23,9 +29,6 @@ if [ "x$PROJECT_DIR_BASENAME" != "xPods" ]; then
|
|
|
23
29
|
exit 0
|
|
24
30
|
fi
|
|
25
31
|
|
|
26
|
-
# ref: https://github.com/facebook/react-native/blob/c974cbff04a8d90ac0f856dbada3fc5a75c75b49/scripts/react-native-xcode.sh#L59-L65
|
|
27
|
-
# Path to expo-constants folder inside node_modules
|
|
28
|
-
EXPO_CONSTANTS_PACKAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
29
32
|
# If PROJECT_ROOT is not specified, fallback to use Xcode PROJECT_DIR
|
|
30
33
|
PROJECT_ROOT=${PROJECT_ROOT:-"$PROJECT_DIR/../.."}
|
|
31
34
|
PROJECT_ROOT=${PROJECT_ROOT:-"$EXPO_CONSTANTS_PACKAGE_DIR/../.."}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# shellcheck shell=bash disable=SC1090,SC1091
|
|
2
|
+
|
|
3
|
+
# Source login scripts to simulate running in an interactive login shell to
|
|
4
|
+
# configure environment variables as if the user had opened a shell. This
|
|
5
|
+
# script is intended for Xcode build phase scripts on macOS and does not have
|
|
6
|
+
# a shebang so it inherits the current shell.
|
|
7
|
+
|
|
8
|
+
current_shell=$(ps -cp "$$" -o comm="" | sed s/^-//)
|
|
9
|
+
|
|
10
|
+
if [[ "$current_shell" == zsh ]]; then
|
|
11
|
+
# Zsh's setup script order is:
|
|
12
|
+
# /etc/zshenv
|
|
13
|
+
# ~/.zshenv
|
|
14
|
+
# /etc/zprofile
|
|
15
|
+
# ~/.zprofile
|
|
16
|
+
# /etc/zshrc
|
|
17
|
+
# ~/.zshrc
|
|
18
|
+
# /etc/zlogin
|
|
19
|
+
# ~/.zlogin
|
|
20
|
+
# http://zsh.sourceforge.net/Guide/zshguide02.html
|
|
21
|
+
|
|
22
|
+
if [ -f /etc/zshenv ]; then . /etc/zshenv; fi
|
|
23
|
+
if [ -f ~/.zshenv ]; then . ~/.zshenv; fi
|
|
24
|
+
if [ -f /etc/zprofile ]; then . /etc/zprofile; fi
|
|
25
|
+
if [ -f ~/.zprofile ]; then . ~/.zprofile; fi
|
|
26
|
+
if [ -f /etc/zshrc ]; then . /etc/zshrc; fi
|
|
27
|
+
if [ -f ~/.zshrc ]; then . ~/.zshrc; fi
|
|
28
|
+
if [ -f /etc/zlogin ]; then . /etc/zlogin; fi
|
|
29
|
+
if [ -f ~/zlogin ]; then . ~/zlogin; fi
|
|
30
|
+
else
|
|
31
|
+
# Bash's setup script order is:
|
|
32
|
+
# /etc/profile (if it exists)
|
|
33
|
+
# The first of: ~/.bash_profile, ~/.bash_login, and ~/.profile
|
|
34
|
+
# https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
|
|
35
|
+
|
|
36
|
+
if [ -f /etc/profile ]; then . /etc/profile; fi
|
|
37
|
+
|
|
38
|
+
if [ -f ~/.bash_profile ]; then
|
|
39
|
+
. ~/.bash_profile
|
|
40
|
+
elif [ -f ~/.bash_login ]; then
|
|
41
|
+
. ~/.bash_login
|
|
42
|
+
elif [ -f ~/.profile ]; then
|
|
43
|
+
. ~/.profile
|
|
44
|
+
fi
|
|
45
|
+
fi
|
package/src/Constants.ts
CHANGED
|
@@ -83,59 +83,57 @@ const constants: Constants = {
|
|
|
83
83
|
appOwnership: appOwnership ?? null,
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Object.defineProperties(constants, {
|
|
87
87
|
// Deprecated fields
|
|
88
|
-
deviceYearClass
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
deviceYearClass: {
|
|
89
|
+
get() {
|
|
90
|
+
if (!warnedAboutDeviceYearClass) {
|
|
91
|
+
console.warn(
|
|
92
|
+
`Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`
|
|
93
|
+
);
|
|
94
|
+
warnedAboutDeviceYearClass = true;
|
|
95
|
+
}
|
|
96
|
+
return nativeConstants.deviceYearClass;
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
96
99
|
},
|
|
97
100
|
// Deprecated fields
|
|
98
|
-
installationId
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
installationId: {
|
|
102
|
+
get() {
|
|
103
|
+
if (!warnedAboutInstallationId) {
|
|
104
|
+
console.warn(
|
|
105
|
+
`Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`
|
|
106
|
+
);
|
|
107
|
+
warnedAboutInstallationId = true;
|
|
108
|
+
}
|
|
109
|
+
return nativeConstants.installationId;
|
|
110
|
+
},
|
|
111
|
+
enumerable: false,
|
|
106
112
|
},
|
|
107
113
|
// Legacy aliases
|
|
108
|
-
deviceId
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
console.warn(
|
|
120
|
-
`Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`
|
|
121
|
-
);
|
|
122
|
-
warnedAboutLinkingUrl = true;
|
|
123
|
-
}
|
|
124
|
-
return nativeConstants.linkingUri;
|
|
125
|
-
},
|
|
126
|
-
manifest(): AppManifest | null {
|
|
127
|
-
const maybeManifest = getManifest();
|
|
128
|
-
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
return maybeManifest;
|
|
114
|
+
deviceId: {
|
|
115
|
+
get() {
|
|
116
|
+
if (!warnedAboutDeviceId) {
|
|
117
|
+
console.warn(
|
|
118
|
+
`Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`
|
|
119
|
+
);
|
|
120
|
+
warnedAboutDeviceId = true;
|
|
121
|
+
}
|
|
122
|
+
return nativeConstants.installationId;
|
|
123
|
+
},
|
|
124
|
+
enumerable: false,
|
|
132
125
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
126
|
+
linkingUrl: {
|
|
127
|
+
get() {
|
|
128
|
+
if (!warnedAboutLinkingUrl) {
|
|
129
|
+
console.warn(
|
|
130
|
+
`Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`
|
|
131
|
+
);
|
|
132
|
+
warnedAboutLinkingUrl = true;
|
|
133
|
+
}
|
|
134
|
+
return nativeConstants.linkingUri;
|
|
135
|
+
},
|
|
136
|
+
enumerable: false,
|
|
139
137
|
},
|
|
140
138
|
/**
|
|
141
139
|
* Use `manifest` property by default.
|
|
@@ -143,39 +141,62 @@ const constantsPropertiesGetter: AccessorProps = {
|
|
|
143
141
|
* It behaves similarly to the original one, but suppresses warning upon no manifest available.
|
|
144
142
|
* `expo-asset` uses it to prevent users from seeing mentioned warning.
|
|
145
143
|
*/
|
|
146
|
-
__unsafeNoWarnManifest
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
__unsafeNoWarnManifest: {
|
|
145
|
+
get(): AppManifest | Manifest | null {
|
|
146
|
+
const maybeManifest = getManifest(true);
|
|
147
|
+
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return maybeManifest;
|
|
151
|
+
},
|
|
152
|
+
enumerable: false,
|
|
152
153
|
},
|
|
153
|
-
__unsafeNoWarnManifest2
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
__unsafeNoWarnManifest2: {
|
|
155
|
+
get(): Manifest | Manifest | null {
|
|
156
|
+
const maybeManifest = getManifest(true);
|
|
157
|
+
if (!maybeManifest || !isManifest(maybeManifest)) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
return maybeManifest;
|
|
161
|
+
},
|
|
162
|
+
enumerable: false,
|
|
159
163
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
manifest: {
|
|
165
|
+
get(): AppManifest | null {
|
|
166
|
+
const maybeManifest = getManifest();
|
|
167
|
+
if (!maybeManifest || !isAppManifest(maybeManifest)) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return maybeManifest;
|
|
171
|
+
},
|
|
172
|
+
enumerable: true,
|
|
166
173
|
},
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
manifest2: {
|
|
175
|
+
get(): Manifest | null {
|
|
176
|
+
const maybeManifest = getManifest();
|
|
177
|
+
if (!maybeManifest || !isManifest(maybeManifest)) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
return maybeManifest;
|
|
181
|
+
},
|
|
182
|
+
enumerable: true,
|
|
183
|
+
},
|
|
184
|
+
__rawManifest_TEST: {
|
|
185
|
+
get(): AppManifest | Manifest | null {
|
|
186
|
+
return rawManifest;
|
|
187
|
+
},
|
|
188
|
+
set(value: AppManifest | Manifest | null) {
|
|
189
|
+
rawManifest = value;
|
|
190
|
+
},
|
|
191
|
+
enumerable: false,
|
|
169
192
|
},
|
|
170
|
-
// Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
|
|
171
|
-
enumerable: false,
|
|
172
193
|
});
|
|
173
194
|
|
|
174
195
|
// Add deprecation warning for `platform.ios.model`
|
|
175
196
|
if (constants?.platform?.ios) {
|
|
176
197
|
const originalModel = nativeConstants.platform.ios.model;
|
|
177
|
-
|
|
178
|
-
|
|
198
|
+
Object.defineProperty(constants.platform.ios, 'model', {
|
|
199
|
+
get() {
|
|
179
200
|
if (!warnedAboutIosModel) {
|
|
180
201
|
console.warn(
|
|
181
202
|
`Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`
|
|
@@ -184,20 +205,10 @@ if (constants?.platform?.ios) {
|
|
|
184
205
|
}
|
|
185
206
|
return originalModel;
|
|
186
207
|
},
|
|
208
|
+
enumerable: false,
|
|
187
209
|
});
|
|
188
210
|
}
|
|
189
211
|
|
|
190
|
-
type AccessorProps = Record<string, () => any>;
|
|
191
|
-
function definePropertiesGetter(target: object, props: AccessorProps) {
|
|
192
|
-
for (const [name, func] of Object.entries(props)) {
|
|
193
|
-
Object.defineProperty(target, name, {
|
|
194
|
-
get: func,
|
|
195
|
-
// Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
|
|
196
|
-
enumerable: false,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
212
|
function isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {
|
|
202
213
|
return !isManifest(manifest);
|
|
203
214
|
}
|
package/src/Constants.types.ts
CHANGED
|
@@ -1,36 +1,80 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config-types';
|
|
2
2
|
|
|
3
|
+
// @needsAudit
|
|
3
4
|
export enum AppOwnership {
|
|
5
|
+
/**
|
|
6
|
+
* It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
|
|
7
|
+
*/
|
|
4
8
|
Standalone = 'standalone',
|
|
9
|
+
/**
|
|
10
|
+
* The experience is running inside of the Expo Go app.
|
|
11
|
+
*/
|
|
5
12
|
Expo = 'expo',
|
|
13
|
+
/**
|
|
14
|
+
* It has been opened through a link from a standalone app.
|
|
15
|
+
*/
|
|
6
16
|
Guest = 'guest',
|
|
7
17
|
}
|
|
8
18
|
|
|
19
|
+
// @docsMissing
|
|
9
20
|
export enum ExecutionEnvironment {
|
|
10
21
|
Bare = 'bare',
|
|
11
22
|
Standalone = 'standalone',
|
|
12
23
|
StoreClient = 'storeClient',
|
|
13
24
|
}
|
|
14
25
|
|
|
26
|
+
// @needsAudit
|
|
27
|
+
/**
|
|
28
|
+
* Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
|
|
29
|
+
* as `unsupported`.
|
|
30
|
+
*/
|
|
15
31
|
export enum UserInterfaceIdiom {
|
|
16
32
|
Handset = 'handset',
|
|
17
33
|
Tablet = 'tablet',
|
|
18
34
|
Unsupported = 'unsupported',
|
|
19
35
|
}
|
|
20
36
|
|
|
37
|
+
// @needsAudit
|
|
21
38
|
export interface IOSManifest {
|
|
39
|
+
/**
|
|
40
|
+
* The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.
|
|
41
|
+
* In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This
|
|
42
|
+
* may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest
|
|
43
|
+
* can be updated, whereas this value will never change for a given native binary.
|
|
44
|
+
* The value is set to `null` in case you run your app in Expo Go.
|
|
45
|
+
*/
|
|
22
46
|
buildNumber: string;
|
|
47
|
+
/**
|
|
48
|
+
* The Apple internal model identifier for this device, e.g. `iPhone1,1`.
|
|
49
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).
|
|
50
|
+
*/
|
|
23
51
|
platform: string;
|
|
24
52
|
/**
|
|
25
|
-
*
|
|
53
|
+
* The human-readable model name of this device, e.g. `"iPhone 7 Plus"` if it can be determined,
|
|
54
|
+
* otherwise will be `null`.
|
|
55
|
+
* @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).
|
|
26
56
|
*/
|
|
27
57
|
model: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.
|
|
60
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).
|
|
61
|
+
*/
|
|
28
62
|
userInterfaceIdiom: UserInterfaceIdiom;
|
|
63
|
+
/**
|
|
64
|
+
* The version of iOS running on this device, e.g. `10.3`.
|
|
65
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).
|
|
66
|
+
*/
|
|
29
67
|
systemVersion: string;
|
|
30
68
|
[key: string]: any;
|
|
31
69
|
}
|
|
32
70
|
|
|
71
|
+
// @needsAudit
|
|
33
72
|
export interface AndroidManifest {
|
|
73
|
+
/**
|
|
74
|
+
* The version code set by `android.versionCode` in app.json.
|
|
75
|
+
* The value is set to `null` in case you run your app in Expo Go.
|
|
76
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
|
|
77
|
+
*/
|
|
34
78
|
versionCode: number;
|
|
35
79
|
[key: string]: any;
|
|
36
80
|
}
|
|
@@ -39,10 +83,12 @@ export interface WebManifest {
|
|
|
39
83
|
[key: string]: any;
|
|
40
84
|
}
|
|
41
85
|
|
|
86
|
+
// @docsMissing
|
|
42
87
|
export interface ManifestAsset {
|
|
43
88
|
url: string;
|
|
44
89
|
}
|
|
45
90
|
|
|
91
|
+
// @needsAudit @docsMissing
|
|
46
92
|
/**
|
|
47
93
|
* A modern manifest.
|
|
48
94
|
*/
|
|
@@ -53,21 +99,26 @@ export type Manifest = {
|
|
|
53
99
|
launchAsset: ManifestAsset;
|
|
54
100
|
assets: ManifestAsset[];
|
|
55
101
|
metadata: object;
|
|
56
|
-
extra?:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
102
|
+
extra?: ManifestExtra;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// @docsMissing
|
|
106
|
+
export type ManifestExtra = ClientScopingConfig & {
|
|
107
|
+
expoClient?: ExpoClientConfig;
|
|
108
|
+
expoGo?: ExpoGoConfig;
|
|
109
|
+
eas?: EASConfig;
|
|
61
110
|
};
|
|
62
111
|
|
|
112
|
+
// @needsAudit
|
|
63
113
|
export type EASConfig = {
|
|
64
114
|
/**
|
|
65
|
-
* The ID for this project if it's using EAS. UUID. This value will not change when a project is
|
|
66
|
-
* between accounts or renamed.
|
|
115
|
+
* The ID for this project if it's using EAS. UUID. This value will not change when a project is
|
|
116
|
+
* transferred between accounts or renamed.
|
|
67
117
|
*/
|
|
68
118
|
projectId?: string;
|
|
69
119
|
};
|
|
70
120
|
|
|
121
|
+
// @needsAudit
|
|
71
122
|
export type ClientScopingConfig = {
|
|
72
123
|
/**
|
|
73
124
|
* An opaque unique string for scoping client-side data to this project. This value
|
|
@@ -76,6 +127,7 @@ export type ClientScopingConfig = {
|
|
|
76
127
|
scopeKey?: string;
|
|
77
128
|
};
|
|
78
129
|
|
|
130
|
+
// @docsMissing
|
|
79
131
|
export type ExpoGoConfig = {
|
|
80
132
|
mainModuleName?: string;
|
|
81
133
|
debuggerHost?: string;
|
|
@@ -84,41 +136,43 @@ export type ExpoGoConfig = {
|
|
|
84
136
|
tool?: string;
|
|
85
137
|
[key: string]: any;
|
|
86
138
|
};
|
|
87
|
-
packagerOpts?:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
139
|
+
packagerOpts?: ExpoGoPackagerOpts;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// @docsMissing
|
|
143
|
+
export type ExpoGoPackagerOpts = {
|
|
144
|
+
hostType?: string;
|
|
145
|
+
dev?: boolean;
|
|
146
|
+
strict?: boolean;
|
|
147
|
+
minify?: boolean;
|
|
148
|
+
urlType?: string;
|
|
149
|
+
urlRandomness?: string;
|
|
150
|
+
lanType?: string;
|
|
151
|
+
[key: string]: any;
|
|
97
152
|
};
|
|
98
153
|
|
|
99
154
|
export type ExpoClientConfig = ExpoConfig & {
|
|
100
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Published apps only.
|
|
157
|
+
*/
|
|
101
158
|
releaseId?: string;
|
|
102
159
|
revisionId?: string;
|
|
103
160
|
releaseChannel?: string;
|
|
104
161
|
bundleUrl: string;
|
|
105
162
|
hostUri?: string;
|
|
106
163
|
publishedTime?: string;
|
|
107
|
-
|
|
108
164
|
/**
|
|
109
165
|
* The Expo account name and slug for this project.
|
|
110
|
-
* @deprecated
|
|
111
|
-
* scoping due to immutability.
|
|
166
|
+
* @deprecated Prefer `projectId` or `originalFullName` instead for identification and
|
|
167
|
+
* `scopeKey` for scoping due to immutability.
|
|
112
168
|
*/
|
|
113
169
|
id?: string;
|
|
114
|
-
|
|
115
170
|
/**
|
|
116
171
|
* The original Expo account name and slug for this project. Formatted like `@username/slug`.
|
|
117
172
|
* When unauthenticated, the username is `@anonymous`. For published projects, this value
|
|
118
173
|
* will not change when a project is transferred between accounts or renamed.
|
|
119
174
|
*/
|
|
120
175
|
originalFullName?: string;
|
|
121
|
-
|
|
122
176
|
/**
|
|
123
177
|
* The Expo account name and slug used for display purposes. Formatted like `@username/slug`.
|
|
124
178
|
* When unauthenticated, the username is `@anonymous`. For published projects, this value
|
|
@@ -128,6 +182,7 @@ export type ExpoClientConfig = ExpoConfig & {
|
|
|
128
182
|
};
|
|
129
183
|
|
|
130
184
|
/**
|
|
185
|
+
* @hidden
|
|
131
186
|
* A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest
|
|
132
187
|
*/
|
|
133
188
|
export type AppManifest = ExpoClientConfig &
|
|
@@ -137,6 +192,7 @@ export type AppManifest = ExpoClientConfig &
|
|
|
137
192
|
[key: string]: any;
|
|
138
193
|
};
|
|
139
194
|
|
|
195
|
+
// @needsAudit @docsMissing
|
|
140
196
|
export interface PlatformManifest {
|
|
141
197
|
ios?: IOSManifest;
|
|
142
198
|
android?: AndroidManifest;
|
|
@@ -152,13 +208,26 @@ export interface PlatformManifest {
|
|
|
152
208
|
[key: string]: any;
|
|
153
209
|
}
|
|
154
210
|
|
|
211
|
+
// @needsAudit @docsMissing
|
|
212
|
+
/**
|
|
213
|
+
* @hidden
|
|
214
|
+
*/
|
|
155
215
|
export interface NativeConstants {
|
|
156
216
|
name: 'ExponentConstants';
|
|
217
|
+
/**
|
|
218
|
+
* Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow
|
|
219
|
+
* and classic builds; for apps built with EAS Build and in bare workflow, the result is
|
|
220
|
+
* always `null`.
|
|
221
|
+
*/
|
|
157
222
|
appOwnership: AppOwnership | null;
|
|
158
223
|
debugMode: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* A human-readable name for the device type.
|
|
226
|
+
*/
|
|
159
227
|
deviceName?: string;
|
|
160
228
|
/**
|
|
161
|
-
*
|
|
229
|
+
* The [device year class](https://github.com/facebook/device-year-class) of this device.
|
|
230
|
+
* @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).
|
|
162
231
|
*/
|
|
163
232
|
deviceYearClass: number | null;
|
|
164
233
|
executionEnvironment: ExecutionEnvironment;
|
|
@@ -166,21 +235,38 @@ export interface NativeConstants {
|
|
|
166
235
|
// only nullable on web
|
|
167
236
|
expoRuntimeVersion: string | null;
|
|
168
237
|
/**
|
|
169
|
-
* The version string of the Expo
|
|
238
|
+
* The version string of the Expo Go app currently running.
|
|
170
239
|
* Returns `null` in bare workflow and web.
|
|
171
240
|
*/
|
|
172
241
|
expoVersion: string | null;
|
|
173
242
|
isDetached?: boolean;
|
|
174
243
|
intentUri?: string;
|
|
175
244
|
/**
|
|
176
|
-
*
|
|
245
|
+
* An identifier that is unique to this particular device and whose lifetime is at least as long
|
|
246
|
+
* as the installation of the app.
|
|
247
|
+
* @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and
|
|
177
248
|
* storing it. This API will be removed in SDK 44.
|
|
178
249
|
*/
|
|
179
250
|
installationId: string;
|
|
251
|
+
/**
|
|
252
|
+
* `true` if the app is running on a device, `false` if running in a simulator or emulator.
|
|
253
|
+
* @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).
|
|
254
|
+
*/
|
|
180
255
|
isDevice: boolean;
|
|
181
256
|
isHeadless: boolean;
|
|
182
257
|
linkingUri: string;
|
|
258
|
+
/**
|
|
259
|
+
* The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set
|
|
260
|
+
* by `version` in app.json on Android at the time the native app was built.
|
|
261
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).
|
|
262
|
+
*/
|
|
183
263
|
nativeAppVersion: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in
|
|
266
|
+
* **app.json** in a standalone app) and the version code set by `android.versionCode` in
|
|
267
|
+
* **app.json** on Android at the time the native app was built.
|
|
268
|
+
* @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
|
|
269
|
+
*/
|
|
184
270
|
nativeBuildVersion: string | null;
|
|
185
271
|
/**
|
|
186
272
|
* Classic manifest for Expo apps using classic updates.
|
|
@@ -192,28 +278,44 @@ export interface NativeConstants {
|
|
|
192
278
|
* Returns `null` in bare workflow and when `manifest` is non-null.
|
|
193
279
|
*/
|
|
194
280
|
manifest2: Manifest | null;
|
|
281
|
+
/**
|
|
282
|
+
* A string that is unique to the current session of your app. It is different across apps and
|
|
283
|
+
* across multiple launches of the same app.
|
|
284
|
+
*/
|
|
195
285
|
sessionId: string;
|
|
286
|
+
/**
|
|
287
|
+
* The default status bar height for the device. Does not factor in changes when location tracking
|
|
288
|
+
* is in use or a phone call is active.
|
|
289
|
+
*/
|
|
196
290
|
statusBarHeight: number;
|
|
291
|
+
/**
|
|
292
|
+
* A list of the system font names available on the current device.
|
|
293
|
+
*/
|
|
197
294
|
systemFonts: string[];
|
|
198
295
|
systemVersion?: number;
|
|
199
296
|
platform?: PlatformManifest;
|
|
200
|
-
|
|
201
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Gets the user agent string which would be included in requests sent by a web view running on
|
|
299
|
+
* this device. This is probably not the same user agent you might be providing in your JS `fetch`
|
|
300
|
+
* requests.
|
|
301
|
+
*/
|
|
202
302
|
getWebViewUserAgentAsync: () => Promise<string | null>;
|
|
303
|
+
[key: string]: any;
|
|
203
304
|
}
|
|
204
305
|
|
|
205
306
|
export interface Constants extends NativeConstants {
|
|
206
307
|
/**
|
|
207
|
-
* @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.
|
|
308
|
+
* @deprecated `Constants.deviceId` is deprecated in favor of generating your own ID and storing it.
|
|
208
309
|
* This API will be removed in SDK 44.
|
|
209
310
|
*/
|
|
210
311
|
deviceId?: string;
|
|
211
312
|
/**
|
|
212
|
-
* @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri
|
|
213
|
-
* Linking API directly. Constants.linkingUrl will be removed in SDK 44.
|
|
313
|
+
* @deprecated `Constants.linkingUrl` has been renamed to `Constants.linkingUri`. Consider using the
|
|
314
|
+
* Linking API directly. `Constants.linkingUrl` will be removed in SDK 44.
|
|
214
315
|
*/
|
|
215
316
|
linkingUrl?: string;
|
|
216
317
|
/**
|
|
318
|
+
* @hidden
|
|
217
319
|
* @warning do not use this property. Use `manifest` by default.
|
|
218
320
|
*
|
|
219
321
|
* In certain cases accessing manifest via this property
|
|
@@ -221,6 +323,7 @@ export interface Constants extends NativeConstants {
|
|
|
221
323
|
*/
|
|
222
324
|
__unsafeNoWarnManifest?: AppManifest;
|
|
223
325
|
/**
|
|
326
|
+
* @hidden
|
|
224
327
|
* @warning do not use this property. Use `manifest2` by default.
|
|
225
328
|
*
|
|
226
329
|
* In certain cases accessing manifest via this property
|