expo-application 58.0.4 → 58.1.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/build.gradle +2 -2
  3. package/build/Application.d.ts +20 -2
  4. package/build/Application.js +22 -0
  5. package/build/Application.js.map +1 -1
  6. package/build/Application.types.d.ts +16 -0
  7. package/ios/ApplicationModule.swift +22 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.module → 58.1.0/expo.modules.application-58.1.0.module} +7 -7
  9. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.module.md5 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.module.sha1 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.module.sha256 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.module.sha512 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.pom → 58.1.0/expo.modules.application-58.1.0.pom} +1 -1
  14. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.pom.md5 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.pom.sha1 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.pom.sha256 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.1.0/expo.modules.application-58.1.0.pom.sha512 +1 -0
  18. package/package.json +3 -3
  19. package/src/Application.ts +26 -0
  20. package/src/Application.types.ts +17 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.module.md5 +0 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.module.sha1 +0 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.module.sha256 +0 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.module.sha512 +0 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.pom.md5 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.pom.sha1 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.pom.sha256 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.application/58.0.4/expo.modules.application-58.0.4.pom.sha512 +0 -1
  29. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4-sources.jar → 58.1.0/expo.modules.application-58.1.0-sources.jar} +0 -0
  30. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4-sources.jar.md5 → 58.1.0/expo.modules.application-58.1.0-sources.jar.md5} +0 -0
  31. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4-sources.jar.sha1 → 58.1.0/expo.modules.application-58.1.0-sources.jar.sha1} +0 -0
  32. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4-sources.jar.sha256 → 58.1.0/expo.modules.application-58.1.0-sources.jar.sha256} +0 -0
  33. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4-sources.jar.sha512 → 58.1.0/expo.modules.application-58.1.0-sources.jar.sha512} +0 -0
  34. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.aar → 58.1.0/expo.modules.application-58.1.0.aar} +0 -0
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.aar.md5 → 58.1.0/expo.modules.application-58.1.0.aar.md5} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.aar.sha1 → 58.1.0/expo.modules.application-58.1.0.aar.sha1} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.aar.sha256 → 58.1.0/expo.modules.application-58.1.0.aar.sha256} +0 -0
  38. /package/local-maven-repo/host/exp/exponent/expo.modules.application/{58.0.4/expo.modules.application-58.0.4.aar.sha512 → 58.1.0/expo.modules.application-58.1.0.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [iOS] Add `getAppleStoreEnvironmentAsync()`, which returns StoreKit's App Store environment for the running build (`'production'`, `'sandbox'` or `'xcode'`), so apps can tell TestFlight, App Review and development builds apart from App Store releases. ([#51209](https://github.com/expo/expo/pull/51209) by [@huntie](https://github.com/huntie))
8
+
3
9
  ## 58.0.4
4
10
 
5
11
  ### Patch Changes
@@ -4,7 +4,7 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '58.0.4'
7
+ version = '58.1.0'
8
8
 
9
9
  expoModule {
10
10
  v2 true
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.application"
15
15
  defaultConfig {
16
16
  versionCode 12
17
- versionName '58.0.4'
17
+ versionName '58.1.0'
18
18
  }
19
19
  }
20
20
 
@@ -1,4 +1,4 @@
1
- import type { ApplicationReleaseType, PushNotificationServiceEnvironment } from './Application.types';
1
+ import type { ApplicationReleaseType, PushNotificationServiceEnvironment, AppleAppStoreEnvironment } from './Application.types';
2
2
  /**
3
3
  * The human-readable version of the native application that may be displayed in the app store.
4
4
  * At time when native app is built, on Android, this is the version name set by `version`
@@ -91,6 +91,24 @@ export declare function getIosIdForVendorAsync(): Promise<string | null>;
91
91
  * @platform ios
92
92
  */
93
93
  export declare function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType>;
94
+ /**
95
+ * Gets the App Store environment of the running build. Unlike
96
+ * [`getIosApplicationReleaseTypeAsync`](#applicationgetiosapplicationreleasetypeasync), which
97
+ * reports `APP_STORE` for both a TestFlight build and an App Store release, this tells them apart.
98
+ * In Expo Go, this reports Expo Go's own environment.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * if ((await Application.getAppleStoreEnvironmentAsync()) === 'sandbox') {
103
+ * // Show settings for TestFlight testers, App Review and development builds
104
+ * }
105
+ * ```
106
+ * @return A `Promise` which fulfills with an
107
+ * [`AppleAppStoreEnvironment`](#appleappstoreenvironment).
108
+ * @platform ios
109
+ * @platform tvos
110
+ */
111
+ export declare function getAppleStoreEnvironmentAsync(): Promise<AppleAppStoreEnvironment>;
94
112
  /**
95
113
  * Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
96
114
  * service environment.
@@ -130,4 +148,4 @@ export declare function getInstallationTimeAsync(): Promise<Date>;
130
148
  * @platform android
131
149
  */
132
150
  export declare function getLastUpdateTimeAsync(): Promise<Date>;
133
- export { ApplicationReleaseType, type PushNotificationServiceEnvironment, } from './Application.types';
151
+ export { ApplicationReleaseType, type PushNotificationServiceEnvironment, type AppleAppStoreEnvironment, } from './Application.types';
@@ -112,6 +112,28 @@ import ExpoApplication from './ExpoApplication';
112
112
  }
113
113
  return await ExpoApplication.getApplicationReleaseTypeAsync();
114
114
  }
115
+ /**
116
+ * Gets the App Store environment of the running build. Unlike
117
+ * [`getIosApplicationReleaseTypeAsync`](#applicationgetiosapplicationreleasetypeasync), which
118
+ * reports `APP_STORE` for both a TestFlight build and an App Store release, this tells them apart.
119
+ * In Expo Go, this reports Expo Go's own environment.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * if ((await Application.getAppleStoreEnvironmentAsync()) === 'sandbox') {
124
+ * // Show settings for TestFlight testers, App Review and development builds
125
+ * }
126
+ * ```
127
+ * @return A `Promise` which fulfills with an
128
+ * [`AppleAppStoreEnvironment`](#appleappstoreenvironment).
129
+ * @platform ios
130
+ * @platform tvos
131
+ */ export async function getAppleStoreEnvironmentAsync() {
132
+ if (!ExpoApplication.getStoreEnvironmentAsync) {
133
+ throw new UnavailabilityError('expo-application', 'getStoreEnvironmentAsync');
134
+ }
135
+ return await ExpoApplication.getStoreEnvironmentAsync();
136
+ }
115
137
  // @needsAudit
116
138
  /**
117
139
  * Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
@@ -1 +1 @@
1
- {"version":3,"sources":["Application.ts"],"sourcesContent":[null],"names":["Platform","UnavailabilityError","ExpoApplication","nativeApplicationVersion","nativeBuildVersion","applicationName","applicationId","getAndroidId","OS","androidId","getInstallReferrerAsync","getIosIdForVendorAsync","getIosApplicationReleaseTypeAsync","getApplicationReleaseTypeAsync","getIosPushNotificationServiceEnvironmentAsync","getPushNotificationServiceEnvironmentAsync","getInstallationTimeAsync","installationTime","Date","getLastUpdateTimeAsync","lastUpdateTime","ApplicationReleaseType"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,OAAO;AAMrD,OAAOC,qBAAqB,oBAAoB;AAEhD,cAAc;AACd;;;;;;;CAOC,GACD,OAAO,MAAMC,2BAA0CD,kBACnDA,gBAAgBC,wBAAwB,IAAI,OAC5C,KAAK;AAET,cAAc;AACd;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAoCF,kBAC7CA,gBAAgBE,kBAAkB,IAAI,OACtC,KAAK;AAET,cAAc;AACd;;;;;;CAMC,GACD,OAAO,MAAMC,kBAAiCH,kBAC1CA,gBAAgBG,eAAe,IAAI,OACnC,KAAK;AAET,cAAc;AACd;;;;;CAKC,GACD,OAAO,MAAMC,gBAA+BJ,kBACxCA,gBAAgBI,aAAa,IA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QAC3C,MAAM,IAAIlB,oBAAoB,oBAAoB;IACpD;IACA,MAAMmB,iBAAiB,MAAMlB,gBAAgBiB,sBAAsB;IACnE,OAAO,IAAID,KAAKE;AAClB;AAEA,SACEC,sBAAsB,QAEjB,sBAAsB"}
1
+ {"version":3,"sources":["Application.ts"],"sourcesContent":[null],"names":["Platform","UnavailabilityError","ExpoApplication","nativeApplicationVersion","nativeBuildVersion","applicationName","applicationId","getAndroidId","OS","androidId","getInstallReferrerAsync","getIosIdForVendorAsync","getIosApplicationReleaseTypeAsync","getApplicationReleaseTypeAsync","getAppleStoreEnvironmentAsync","getStoreEnvironmentAsync","getIosPushNotificationServiceEnvironmentAsync","getPushNotificationServiceEnvironmentAsync","getInstallationTimeAsync","installationTime","Date","getLastUpdateTimeAsync","lastUpdateTime","ApplicationReleaseType"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,OAAO;AAOrD,OAAOC,qBAAqB,oBAAoB;AAEhD,cAAc;AACd;;;;;;;CAOC,GACD,OAAO,MAAMC,2BAA0CD,kBACnDA,gBAAgBC,wBAAwB,IAAI,OAC5C,KAAK;AAET,cAAc;AACd;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAoCF,kBAC7CA,gBAAgBE,kBAAkB,IAAI,OACtC,KAAK;AAET,cAAc;AACd;;;;;;CAMC,GACD,OAAO,MAAMC,kBAAiCH,kBAC1CA,gBAAgBG,eAAe,IAAI,OACnC,KAAK;AAET,cAAc;AACd;;;;;CAKC,GACD,OAAO,MAAMC,gBAA+BJ,kBACxCA,gBAAgBI,aAAa,IAAI,OACjC,KAAK;AAET,cAAc;AACd;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASC;IACd,IAAIP,SAASQ,EAAE,KAAK,WAAW;QAC7B,MAAM,IAAIP,oBAAoB,oBAAoB;IACpD;IACA,OAAOC,gBAAgBO,SAAS;AAClC;AAEA,cAAc;AACd;;;;;;;;;;;CAWC,GACD,OAAO,eAAeC;IACp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AAiB,MAAMpB,gBAAgBmB,sBAAsB;IACnE,OAAO,IAAID,KAAKE;AAClB;AAEA,SACEC,sBAAsB,QAGjB,sBAAsB"}
@@ -14,3 +14,19 @@ export declare enum ApplicationReleaseType {
14
14
  * @platform ios
15
15
  */
16
16
  export type PushNotificationServiceEnvironment = 'development' | 'production' | null;
17
+ /**
18
+ * Maps to StoreKit's
19
+ * [`AppStore.Environment`](https://developer.apple.com/documentation/storekit/appstore/environment),
20
+ * as reported by the app's
21
+ * [`AppTransaction.environment`](https://developer.apple.com/documentation/storekit/apptransaction/environment).
22
+ * - `'production'`: An App Store release.
23
+ * - `'sandbox'`: A TestFlight build, a build under App Store Review, or a development, ad hoc, or
24
+ * enterprise-signed build.
25
+ * - `'xcode'`: A build run with a StoreKit configuration file in Xcode.
26
+ * - `null`: StoreKit returns no verified app transaction, or an environment that this version does
27
+ * not recognize. A missing transaction happens on a simulator without a StoreKit configuration
28
+ * file, or when the user is offline or signed out of the App Store before StoreKit caches one.
29
+ * @platform ios
30
+ * @platform tvos
31
+ */
32
+ export type AppleAppStoreEnvironment = 'production' | 'sandbox' | 'xcode' | null;
@@ -1,5 +1,6 @@
1
1
  // Copyright 2018-present 650 Industries. All rights reserved.
2
2
  import ExpoModulesCore
3
+ import StoreKit
3
4
 
4
5
  @ExpoModule("ExpoApplication")
5
6
  public class ApplicationModule: Module {
@@ -58,6 +59,27 @@ public class ApplicationModule: Module {
58
59
  return mainProvisioningProfile.appReleaseType().rawValue
59
60
  }
60
61
 
62
+ @JS(.concurrent)
63
+ func getStoreEnvironmentAsync() async -> String? {
64
+ guard case .verified(let transaction) = try? await AppTransaction.shared else {
65
+ return nil
66
+ }
67
+ return Self.storeEnvironment(transaction.environment)
68
+ }
69
+
70
+ static func storeEnvironment(_ environment: AppStore.Environment) -> String? {
71
+ switch environment {
72
+ case .production:
73
+ return "production"
74
+ case .sandbox:
75
+ return "sandbox"
76
+ case .xcode:
77
+ return "xcode"
78
+ default:
79
+ return nil
80
+ }
81
+ }
82
+
61
83
  @JS(.concurrent)
62
84
  func getPushNotificationServiceEnvironmentAsync() async -> String? {
63
85
  let mainProvisioningProfile = EXProvisioningProfile.main()
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.application",
6
- "version": "58.0.4",
6
+ "version": "58.1.0",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.application-58.0.4.aar",
28
- "url": "expo.modules.application-58.0.4.aar",
27
+ "name": "expo.modules.application-58.1.0.aar",
28
+ "url": "expo.modules.application-58.1.0.aar",
29
29
  "size": 18123,
30
30
  "sha512": "f89769b47863dd16fc59557e328743dbd5e940cbb6a580586b64a52604770f8c9ed27f0573084a9dda31c99da2fe666dbb384320f2bad1aeff7b23cb409cae28",
31
31
  "sha256": "6c42277423ac93c44f93cb6ffc5b99cbaef685a34694c35df18fea38439991d0",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "files": [
76
76
  {
77
- "name": "expo.modules.application-58.0.4.aar",
78
- "url": "expo.modules.application-58.0.4.aar",
77
+ "name": "expo.modules.application-58.1.0.aar",
78
+ "url": "expo.modules.application-58.1.0.aar",
79
79
  "size": 18123,
80
80
  "sha512": "f89769b47863dd16fc59557e328743dbd5e940cbb6a580586b64a52604770f8c9ed27f0573084a9dda31c99da2fe666dbb384320f2bad1aeff7b23cb409cae28",
81
81
  "sha256": "6c42277423ac93c44f93cb6ffc5b99cbaef685a34694c35df18fea38439991d0",
@@ -94,8 +94,8 @@
94
94
  },
95
95
  "files": [
96
96
  {
97
- "name": "expo.modules.application-58.0.4-sources.jar",
98
- "url": "expo.modules.application-58.0.4-sources.jar",
97
+ "name": "expo.modules.application-58.1.0-sources.jar",
98
+ "url": "expo.modules.application-58.1.0-sources.jar",
99
99
  "size": 2703,
100
100
  "sha512": "86e8ef7389ea58be85069e0cc92af6dce9397066c05ff5ef82cbc94319ac21123569e1215983df172e7f8450856e8371f29f311eb4c9258e603f5d9fdb0f07ff",
101
101
  "sha256": "4e6b197ea81366e4ce706c9bf316457bb0a6dffab7a035f91dbeb4376dd0c6f1",
@@ -0,0 +1 @@
1
+ dc8f1a3b74a8e191c06eb967a3c1ca3cb6f70682872dbf0c90b6ebf466182b32
@@ -0,0 +1 @@
1
+ ddae542fb9269d58846983ee76cf94a98a1e2b6220f2cdd2ad36168e1fe637ae6a95c50b7ce9344620f278fa4d9309771b3081991a8f35d42bcebaab9178ebe3
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.application</artifactId>
12
- <version>58.0.4</version>
12
+ <version>58.1.0</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.application</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ e42365123c1db953a954e2a0b3a5010823c49065431add165e4cd1c770305e0e
@@ -0,0 +1 @@
1
+ fe2340cf033c78fc332d7ffd2d06d587b8d448a80d8a7e3d5d1121b23aa88a7c5c3a30c333420fb0aa5f230e5bb07cf1717dadef3228e74efae7712b94b60aa1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-application",
3
- "version": "58.0.4",
3
+ "version": "58.1.0",
4
4
  "description": "A universal module that gets native application information such as its ID, app name, and build version at runtime",
5
5
  "keywords": [
6
6
  "expo",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {},
35
35
  "devDependencies": {
36
- "expo": "58.0.4",
37
- "expo-module-scripts": "56.0.7",
36
+ "@expo/internal-scripts": "58.0.1",
37
+ "expo": "58.0.7",
38
38
  "expo-modules-cli": "0.2.1"
39
39
  },
40
40
  "peerDependencies": {
@@ -3,6 +3,7 @@ import { Platform, UnavailabilityError } from 'expo';
3
3
  import type {
4
4
  ApplicationReleaseType,
5
5
  PushNotificationServiceEnvironment,
6
+ AppleAppStoreEnvironment,
6
7
  } from './Application.types';
7
8
  import ExpoApplication from './ExpoApplication';
8
9
 
@@ -142,6 +143,30 @@ export async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationRe
142
143
  return await ExpoApplication.getApplicationReleaseTypeAsync();
143
144
  }
144
145
 
146
+ /**
147
+ * Gets the App Store environment of the running build. Unlike
148
+ * [`getIosApplicationReleaseTypeAsync`](#applicationgetiosapplicationreleasetypeasync), which
149
+ * reports `APP_STORE` for both a TestFlight build and an App Store release, this tells them apart.
150
+ * In Expo Go, this reports Expo Go's own environment.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * if ((await Application.getAppleStoreEnvironmentAsync()) === 'sandbox') {
155
+ * // Show settings for TestFlight testers, App Review and development builds
156
+ * }
157
+ * ```
158
+ * @return A `Promise` which fulfills with an
159
+ * [`AppleAppStoreEnvironment`](#appleappstoreenvironment).
160
+ * @platform ios
161
+ * @platform tvos
162
+ */
163
+ export async function getAppleStoreEnvironmentAsync(): Promise<AppleAppStoreEnvironment> {
164
+ if (!ExpoApplication.getStoreEnvironmentAsync) {
165
+ throw new UnavailabilityError('expo-application', 'getStoreEnvironmentAsync');
166
+ }
167
+ return await ExpoApplication.getStoreEnvironmentAsync();
168
+ }
169
+
145
170
  // @needsAudit
146
171
  /**
147
172
  * Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
@@ -207,4 +232,5 @@ export async function getLastUpdateTimeAsync(): Promise<Date> {
207
232
  export {
208
233
  ApplicationReleaseType,
209
234
  type PushNotificationServiceEnvironment,
235
+ type AppleAppStoreEnvironment,
210
236
  } from './Application.types';
@@ -16,3 +16,20 @@ export enum ApplicationReleaseType {
16
16
  * @platform ios
17
17
  */
18
18
  export type PushNotificationServiceEnvironment = 'development' | 'production' | null;
19
+
20
+ /**
21
+ * Maps to StoreKit's
22
+ * [`AppStore.Environment`](https://developer.apple.com/documentation/storekit/appstore/environment),
23
+ * as reported by the app's
24
+ * [`AppTransaction.environment`](https://developer.apple.com/documentation/storekit/apptransaction/environment).
25
+ * - `'production'`: An App Store release.
26
+ * - `'sandbox'`: A TestFlight build, a build under App Store Review, or a development, ad hoc, or
27
+ * enterprise-signed build.
28
+ * - `'xcode'`: A build run with a StoreKit configuration file in Xcode.
29
+ * - `null`: StoreKit returns no verified app transaction, or an environment that this version does
30
+ * not recognize. A missing transaction happens on a simulator without a StoreKit configuration
31
+ * file, or when the user is offline or signed out of the App Store before StoreKit caches one.
32
+ * @platform ios
33
+ * @platform tvos
34
+ */
35
+ export type AppleAppStoreEnvironment = 'production' | 'sandbox' | 'xcode' | null;
@@ -1 +0,0 @@
1
- d3f4feecb6404f6cd57637e27c5f8782a2175080f3a8d5424770d0d832bff4a8
@@ -1 +0,0 @@
1
- 28358f0723b7e0741b2298679ec67b5fa531fbc6b5db3187875666f8a36cbb88e0f631dc7faaee43079ceed1594e0ce67f02156c06be8a9f7e4f55d12ef9209a
@@ -1 +0,0 @@
1
- 91103830b98af49c9777e55f9cf06de7430f5bb48d35f7eed5fcca791b15e4f6
@@ -1 +0,0 @@
1
- a992d37cf5f0b25e66fec5e1a891f8456b4d77aacf4c132f2f1741a413a8e065f81de070e1df9467157f331a93e4e13f0e948c54c06b69756f91cfee03c81626