expo-application 4.0.2 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +2 -2
- package/android/build.gradle +29 -10
- package/build/Application.d.ts +4 -2
- package/build/Application.d.ts.map +1 -0
- package/build/Application.js +1 -1
- package/build/Application.js.map +1 -1
- package/build/Application.types.d.ts +1 -0
- package/build/Application.types.d.ts.map +1 -0
- package/build/ExpoApplication.d.ts +1 -0
- package/build/ExpoApplication.d.ts.map +1 -0
- package/build/ExpoApplication.web.d.ts +1 -0
- package/build/ExpoApplication.web.d.ts.map +1 -0
- package/ios/EXApplication/EXApplication.m +1 -1
- package/package.json +2 -2
- package/src/Application.ts +5 -2
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 4.
|
|
13
|
+
## 4.2.1 — 2022-07-18
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Clarify that `getIosPushNotificationServiceEnvironmentAsync` returns `null` on the simulator. ([#18282](https://github.com/expo/expo/pull/18282) by [@tsapeta](https://github.com/tsapeta))
|
|
18
|
+
|
|
19
|
+
## 4.2.0 — 2022-07-07
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
23
|
+
## 4.1.0 — 2022-04-18
|
|
24
|
+
|
|
25
|
+
### ⚠️ Notices
|
|
26
|
+
|
|
27
|
+
- On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
|
|
28
|
+
|
|
29
|
+
## 4.0.2 - 2022-02-01
|
|
14
30
|
|
|
15
31
|
### 🐛 Bug fixes
|
|
16
32
|
|
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@ Gets native application information such as its ID, app name, and build version
|
|
|
4
4
|
|
|
5
5
|
# API documentation
|
|
6
6
|
|
|
7
|
-
- [Documentation for the
|
|
7
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/application.md)
|
|
8
8
|
|
|
9
9
|
# Installation in managed Expo projects
|
|
10
10
|
|
|
11
|
-
For
|
|
11
|
+
For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#https://docs.expo.dev/versions/latest/sdk/application/).
|
|
12
12
|
|
|
13
13
|
# Installation in bare React Native projects
|
|
14
14
|
|
package/android/build.gradle
CHANGED
|
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '4.
|
|
6
|
+
version = '4.2.1'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
10
|
+
if (expoModulesCorePlugin.exists()) {
|
|
11
|
+
apply from: expoModulesCorePlugin
|
|
12
|
+
applyKotlinExpoModulesCorePlugin()
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
10
16
|
ext.safeExtGet = { prop, fallback ->
|
|
11
17
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
// Ensures backward compatibility
|
|
21
|
+
ext.getKotlinVersion = {
|
|
22
|
+
if (ext.has("kotlinVersion")) {
|
|
23
|
+
ext.kotlinVersion()
|
|
24
|
+
} else {
|
|
25
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
14
29
|
repositories {
|
|
15
30
|
mavenCentral()
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
dependencies {
|
|
19
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
34
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
20
35
|
}
|
|
21
36
|
}
|
|
22
37
|
|
|
@@ -44,18 +59,22 @@ afterEvaluate {
|
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
android {
|
|
47
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
48
63
|
|
|
49
64
|
compileOptions {
|
|
50
|
-
sourceCompatibility JavaVersion.
|
|
51
|
-
targetCompatibility JavaVersion.
|
|
65
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
66
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
kotlinOptions {
|
|
70
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
52
71
|
}
|
|
53
72
|
|
|
54
73
|
defaultConfig {
|
|
55
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
56
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
57
76
|
versionCode 12
|
|
58
|
-
versionName '4.
|
|
77
|
+
versionName '4.2.1'
|
|
59
78
|
}
|
|
60
79
|
lintOptions {
|
|
61
80
|
abortOnError false
|
|
@@ -66,10 +85,10 @@ dependencies {
|
|
|
66
85
|
implementation project(':expo-modules-core')
|
|
67
86
|
|
|
68
87
|
implementation 'com.android.installreferrer:installreferrer:1.0'
|
|
69
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
88
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
70
89
|
|
|
71
|
-
if (project.findProject(':
|
|
72
|
-
testImplementation project(':
|
|
90
|
+
if (project.findProject(':expo-modules-test-core')) {
|
|
91
|
+
testImplementation project(':expo-modules-test-core')
|
|
73
92
|
}
|
|
74
93
|
testImplementation "org.robolectric:robolectric:4.5.1"
|
|
75
94
|
testImplementation 'junit:junit:4.12'
|
package/build/Application.d.ts
CHANGED
|
@@ -90,14 +90,15 @@ export declare enum ApplicationReleaseType {
|
|
|
90
90
|
* @platform ios
|
|
91
91
|
*/
|
|
92
92
|
export declare function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType>;
|
|
93
|
+
export declare type PushNotificationServiceEnvironment = 'development' | 'production' | null;
|
|
93
94
|
/**
|
|
94
95
|
* Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
|
|
95
96
|
* service environment.
|
|
96
97
|
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`,
|
|
97
|
-
* based on the current APN environment.
|
|
98
|
+
* based on the current APN environment, or `null` on the simulator as it does not support registering with APNs.
|
|
98
99
|
* @platform ios
|
|
99
100
|
*/
|
|
100
|
-
export declare function getIosPushNotificationServiceEnvironmentAsync(): Promise<
|
|
101
|
+
export declare function getIosPushNotificationServiceEnvironmentAsync(): Promise<PushNotificationServiceEnvironment>;
|
|
101
102
|
/**
|
|
102
103
|
* Gets the time the app was installed onto the device, not counting subsequent updates. If the app
|
|
103
104
|
* is uninstalled and reinstalled, this method returns the time the app was reinstalled.
|
|
@@ -129,3 +130,4 @@ export declare function getInstallationTimeAsync(): Promise<Date>;
|
|
|
129
130
|
* @platform android
|
|
130
131
|
*/
|
|
131
132
|
export declare function getLastUpdateTimeAsync(): Promise<Date>;
|
|
133
|
+
//# sourceMappingURL=Application.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,GAAG,IAExC,CAAC;AAGT;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,GAAG,IAElC,CAAC;AAGT;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,GAAG,IAE/B,CAAC;AAGT;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,GAAG,IAE7B,CAAC;AAGT;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,GAAG,IAAiE,CAAC;AAGnG;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAK/D;AAGD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKrE;AAGD,oBAAY,sBAAsB;IAChC,OAAO,IAAI;IACX,SAAS,IAAI;IACb,UAAU,IAAI;IACd,WAAW,IAAI;IACf,MAAM,IAAI;IACV,SAAS,IAAI;CACd;AAGD;;;;GAIG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAKzF;AAGD,oBAAY,kCAAkC,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC;AAGrF;;;;;;GAMG;AACH,wBAAsB,6CAA6C,IAAI,OAAO,CAAC,kCAAkC,CAAC,CAKjH;AAGD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9D;AAGD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM5D"}
|
package/build/Application.js
CHANGED
|
@@ -130,7 +130,7 @@ export async function getIosApplicationReleaseTypeAsync() {
|
|
|
130
130
|
* Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
|
|
131
131
|
* service environment.
|
|
132
132
|
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`,
|
|
133
|
-
* based on the current APN environment.
|
|
133
|
+
* based on the current APN environment, or `null` on the simulator as it does not support registering with APNs.
|
|
134
134
|
* @platform ios
|
|
135
135
|
*/
|
|
136
136
|
export async function getIosPushNotificationServiceEnvironmentAsync() {
|
package/build/Application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkB,eAAe;IACpE,CAAC,CAAC,eAAe,CAAC,wBAAwB,IAAI,IAAI;IAClD,CAAC,CAAC,IAAI,CAAC;AAET,cAAc;AACd;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAkB,eAAe;IAC9D,CAAC,CAAC,eAAe,CAAC,kBAAkB,IAAI,IAAI;IAC5C,CAAC,CAAC,IAAI,CAAC;AAET,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkB,eAAe;IAC3D,CAAC,CAAC,eAAe,CAAC,eAAe,IAAI,IAAI;IACzC,CAAC,CAAC,IAAI,CAAC;AAET,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB,eAAe;IACzD,CAAC,CAAC,eAAe,CAAC,aAAa,IAAI,IAAI;IACvC,CAAC,CAAC,IAAI,CAAC;AAET,cAAc;AACd;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAkB,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAEnG,cAAc;AACd;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,IAAI,CA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,wBAAwB;IAC5C,IAAI,CAAC,eAAe,CAAC,wBAAwB,EAAE;QAC7C,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;KAC/E;IACD,MAAM,gBAAgB,GAAG,MAAM,eAAe,CAAC,wBAAwB,EAAE,CAAC;IAC1E,OAAO,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACpC,CAAC;AAED,cAAc;AACd;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAE;QAC3C,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAAC;KAC7E;IACD,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,sBAAsB,EAAE,CAAC;IACtE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExpoApplication from './ExpoApplication';\n\n// @needsAudit\n/**\n * The human-readable version of the native application that may be displayed in the app store.\n * This is 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 * On web, this value is `null`.\n * @example `\"2.11.0\"`\n */\nexport const nativeApplicationVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeApplicationVersion || null\n : null;\n\n// @needsAudit\n/**\n * The internal build version of the native application that the app store may use to distinguish\n * between different binaries. This is the `Info.plist` value for `CFBundleVersion` on iOS (set with\n * `ios.buildNumber` value in `app.json` in a standalone app) and the version code set by\n * `android.versionCode` in `app.json` on Android at the time the native app was built. On web, this\n * value is `null`. The return type on Android and iOS is `string`.\n * @example iOS: `\"2.11.0\"`, Android: `\"114\"`\n */\nexport const nativeBuildVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeBuildVersion || null\n : null;\n\n// @needsAudit\n/**\n * The human-readable name of the application that is displayed with the app's icon on the device's\n * home screen or desktop. On Android and iOS, this value is a `string` unless the name could not be\n * retrieved, in which case this value will be `null`. On web this value is `null`.\n * @example `\"Expo\"`, `\"Yelp\"`, `\"Instagram\"`\n */\nexport const applicationName: string | null = ExpoApplication\n ? ExpoApplication.applicationName || null\n : null;\n\n// @needsAudit\n/**\n * The ID of the application. On Android, this is the application ID. On iOS, this is the bundle ID.\n * On web, this is `null`.\n * @example `\"com.cocoacasts.scribbles\"`, `\"com.apple.Pages\"`\n */\nexport const applicationId: string | null = ExpoApplication\n ? ExpoApplication.applicationId || null\n : null;\n\n// @needsAudit\n/**\n * The value of [`Settings.Secure.ANDROID_ID`](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID).\n * This is a hexadecimal `string` unique to each combination of app-signing key, user, and device.\n * The value may change if a factory reset is performed on the device or if an APK signing key changes.\n * For more information about how the platform handles `ANDROID_ID` in Android 8.0 (API level 26)\n * and higher, see [Android 8.0 Behavior Changes](https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all).\n * On iOS and web, this value is `null`.\n * > In versions of the platform lower than Android 8.0 (API level 26), this value remains constant\n * > for the lifetime of the user's device. See the [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID)\n * > official docs for more information.\n * @example `\"dd96dec43fb81c97\"`\n * @platform android\n */\nexport const androidId: string | null = ExpoApplication ? ExpoApplication.androidId || null : null;\n\n// @needsAudit\n/**\n * Gets the referrer URL of the installed app with the [`Install Referrer API`](https://developer.android.com/google/play/installreferrer)\n * from the Google Play Store. In practice, the referrer URL may not be a complete, absolute URL.\n * @return A `Promise` that fulfills with a `string` of the referrer URL of the installed app.\n *\n * @example\n * ```ts\n * await Application.getInstallReferrerAsync();\n * // \"utm_source=google-play&utm_medium=organic\"\n * ```\n * @platform android\n */\nexport async function getInstallReferrerAsync(): Promise<string> {\n if (!ExpoApplication.getInstallReferrerAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallReferrerAsync');\n }\n return await ExpoApplication.getInstallReferrerAsync();\n}\n\n// @needsAudit\n/**\n * Gets the iOS \"identifier for vendor\" ([IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor))\n * value, a string ID that uniquely identifies a device to the app’s vendor. This method may\n * sometimes return `nil`, in which case wait and call the method again later. This might happen\n * when the device has been restarted before the user has unlocked the device.\n *\n * The OS will change the vendor identifier if all apps from the current app's vendor have been\n * uninstalled.\n *\n * @return A `Promise` that fulfills with a `string` specifying the app's vendor ID. Apps from the\n * same vendor will return the same ID. See Apple's documentation for more information about the\n * vendor ID's semantics.\n *\n * @example\n * ```ts\n * await Application.getIosIdForVendorAsync();\n * // \"68753A44-4D6F-1226-9C60-0050E4C00067\"\n * ```\n * @platform ios\n */\nexport async function getIosIdForVendorAsync(): Promise<string | null> {\n if (!ExpoApplication.getIosIdForVendorAsync) {\n throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');\n }\n return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;\n}\n\n// @docsMissing\nexport enum ApplicationReleaseType {\n UNKNOWN = 0,\n SIMULATOR = 1,\n ENTERPRISE = 2,\n DEVELOPMENT = 3,\n AD_HOC = 4,\n APP_STORE = 5,\n}\n\n// @needsAudit\n/**\n * Gets the iOS application release type.\n * @return Returns a promise which fulfills with an [`ApplicationReleaseType`](#applicationreleasetype).\n * @platform ios\n */\nexport async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType> {\n if (!ExpoApplication.getApplicationReleaseTypeAsync) {\n throw new UnavailabilityError('expo-application', 'getApplicationReleaseTypeAsync');\n }\n return await ExpoApplication.getApplicationReleaseTypeAsync();\n}\n\n// @needsAudit\n/**\n * Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)\n * service environment.\n * @return Returns a promise fulfilled with the string, either `'development'` or `'production'`,\n * based on the current APN environment.\n * @platform ios\n */\nexport async function getIosPushNotificationServiceEnvironmentAsync(): Promise<string> {\n if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {\n throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');\n }\n return await ExpoApplication.getPushNotificationServiceEnvironmentAsync();\n}\n\n// @needsAudit\n/**\n * Gets the time the app was installed onto the device, not counting subsequent updates. If the app\n * is uninstalled and reinstalled, this method returns the time the app was reinstalled.\n * - On iOS, this method uses the [`NSFileCreationDate`](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc)\n * of the app's document root directory.\n * - On Android, this method uses [`PackageInfo.firstInstallTime`](https://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime).\n * - On web, this method returns `null`.\n *\n * @return Returns a `Promise` that fulfills with a `Date` object that specifies the time the app\n * was installed on the device.\n *\n * @example\n * ```ts\n * await Application.getInstallationTimeAsync();\n * // 2019-07-18T18:08:26.121Z\n * ```\n */\nexport async function getInstallationTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getInstallationTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallationTimeAsync');\n }\n const installationTime = await ExpoApplication.getInstallationTimeAsync();\n return new Date(installationTime);\n}\n\n// @needsAudit\n/**\n * Gets the last time the app was updated from the Google Play Store.\n * @return Returns a `Promise` that fulfills with a `Date` object that specifies the last time\n * the app was updated via the Google Play Store).\n *\n * @example\n * ```ts\n * await Application.getLastUpdateTimeAsync();\n * // 2019-07-18T21:20:16.887Z\n * ```\n * @platform android\n */\nexport async function getLastUpdateTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getLastUpdateTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getLastUpdateTimeAsync');\n }\n const lastUpdateTime = await ExpoApplication.getLastUpdateTimeAsync();\n return new Date(lastUpdateTime);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AA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AAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAAC;KAC7E;IACD,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,sBAAsB,EAAE,CAAC;IACtE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExpoApplication from './ExpoApplication';\n\n// @needsAudit\n/**\n * The human-readable version of the native application that may be displayed in the app store.\n * This is 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 * On web, this value is `null`.\n * @example `\"2.11.0\"`\n */\nexport const nativeApplicationVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeApplicationVersion || null\n : null;\n\n// @needsAudit\n/**\n * The internal build version of the native application that the app store may use to distinguish\n * between different binaries. This is the `Info.plist` value for `CFBundleVersion` on iOS (set with\n * `ios.buildNumber` value in `app.json` in a standalone app) and the version code set by\n * `android.versionCode` in `app.json` on Android at the time the native app was built. On web, this\n * value is `null`. The return type on Android and iOS is `string`.\n * @example iOS: `\"2.11.0\"`, Android: `\"114\"`\n */\nexport const nativeBuildVersion: string | null = ExpoApplication\n ? ExpoApplication.nativeBuildVersion || null\n : null;\n\n// @needsAudit\n/**\n * The human-readable name of the application that is displayed with the app's icon on the device's\n * home screen or desktop. On Android and iOS, this value is a `string` unless the name could not be\n * retrieved, in which case this value will be `null`. On web this value is `null`.\n * @example `\"Expo\"`, `\"Yelp\"`, `\"Instagram\"`\n */\nexport const applicationName: string | null = ExpoApplication\n ? ExpoApplication.applicationName || null\n : null;\n\n// @needsAudit\n/**\n * The ID of the application. On Android, this is the application ID. On iOS, this is the bundle ID.\n * On web, this is `null`.\n * @example `\"com.cocoacasts.scribbles\"`, `\"com.apple.Pages\"`\n */\nexport const applicationId: string | null = ExpoApplication\n ? ExpoApplication.applicationId || null\n : null;\n\n// @needsAudit\n/**\n * The value of [`Settings.Secure.ANDROID_ID`](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID).\n * This is a hexadecimal `string` unique to each combination of app-signing key, user, and device.\n * The value may change if a factory reset is performed on the device or if an APK signing key changes.\n * For more information about how the platform handles `ANDROID_ID` in Android 8.0 (API level 26)\n * and higher, see [Android 8.0 Behavior Changes](https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all).\n * On iOS and web, this value is `null`.\n * > In versions of the platform lower than Android 8.0 (API level 26), this value remains constant\n * > for the lifetime of the user's device. See the [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID)\n * > official docs for more information.\n * @example `\"dd96dec43fb81c97\"`\n * @platform android\n */\nexport const androidId: string | null = ExpoApplication ? ExpoApplication.androidId || null : null;\n\n// @needsAudit\n/**\n * Gets the referrer URL of the installed app with the [`Install Referrer API`](https://developer.android.com/google/play/installreferrer)\n * from the Google Play Store. In practice, the referrer URL may not be a complete, absolute URL.\n * @return A `Promise` that fulfills with a `string` of the referrer URL of the installed app.\n *\n * @example\n * ```ts\n * await Application.getInstallReferrerAsync();\n * // \"utm_source=google-play&utm_medium=organic\"\n * ```\n * @platform android\n */\nexport async function getInstallReferrerAsync(): Promise<string> {\n if (!ExpoApplication.getInstallReferrerAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallReferrerAsync');\n }\n return await ExpoApplication.getInstallReferrerAsync();\n}\n\n// @needsAudit\n/**\n * Gets the iOS \"identifier for vendor\" ([IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor))\n * value, a string ID that uniquely identifies a device to the app’s vendor. This method may\n * sometimes return `nil`, in which case wait and call the method again later. This might happen\n * when the device has been restarted before the user has unlocked the device.\n *\n * The OS will change the vendor identifier if all apps from the current app's vendor have been\n * uninstalled.\n *\n * @return A `Promise` that fulfills with a `string` specifying the app's vendor ID. Apps from the\n * same vendor will return the same ID. See Apple's documentation for more information about the\n * vendor ID's semantics.\n *\n * @example\n * ```ts\n * await Application.getIosIdForVendorAsync();\n * // \"68753A44-4D6F-1226-9C60-0050E4C00067\"\n * ```\n * @platform ios\n */\nexport async function getIosIdForVendorAsync(): Promise<string | null> {\n if (!ExpoApplication.getIosIdForVendorAsync) {\n throw new UnavailabilityError('expo-application', 'getIosIdForVendorAsync');\n }\n return (await ExpoApplication.getIosIdForVendorAsync()) ?? null;\n}\n\n// @docsMissing\nexport enum ApplicationReleaseType {\n UNKNOWN = 0,\n SIMULATOR = 1,\n ENTERPRISE = 2,\n DEVELOPMENT = 3,\n AD_HOC = 4,\n APP_STORE = 5,\n}\n\n// @needsAudit\n/**\n * Gets the iOS application release type.\n * @return Returns a promise which fulfills with an [`ApplicationReleaseType`](#applicationreleasetype).\n * @platform ios\n */\nexport async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType> {\n if (!ExpoApplication.getApplicationReleaseTypeAsync) {\n throw new UnavailabilityError('expo-application', 'getApplicationReleaseTypeAsync');\n }\n return await ExpoApplication.getApplicationReleaseTypeAsync();\n}\n\n// @docsMissing\nexport type PushNotificationServiceEnvironment = 'development' | 'production' | null;\n\n// @needsAudit\n/**\n * Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)\n * service environment.\n * @return Returns a promise fulfilled with the string, either `'development'` or `'production'`,\n * based on the current APN environment, or `null` on the simulator as it does not support registering with APNs.\n * @platform ios\n */\nexport async function getIosPushNotificationServiceEnvironmentAsync(): Promise<PushNotificationServiceEnvironment> {\n if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {\n throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');\n }\n return await ExpoApplication.getPushNotificationServiceEnvironmentAsync();\n}\n\n// @needsAudit\n/**\n * Gets the time the app was installed onto the device, not counting subsequent updates. If the app\n * is uninstalled and reinstalled, this method returns the time the app was reinstalled.\n * - On iOS, this method uses the [`NSFileCreationDate`](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc)\n * of the app's document root directory.\n * - On Android, this method uses [`PackageInfo.firstInstallTime`](https://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime).\n * - On web, this method returns `null`.\n *\n * @return Returns a `Promise` that fulfills with a `Date` object that specifies the time the app\n * was installed on the device.\n *\n * @example\n * ```ts\n * await Application.getInstallationTimeAsync();\n * // 2019-07-18T18:08:26.121Z\n * ```\n */\nexport async function getInstallationTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getInstallationTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getInstallationTimeAsync');\n }\n const installationTime = await ExpoApplication.getInstallationTimeAsync();\n return new Date(installationTime);\n}\n\n// @needsAudit\n/**\n * Gets the last time the app was updated from the Google Play Store.\n * @return Returns a `Promise` that fulfills with a `Date` object that specifies the last time\n * the app was updated via the Google Play Store).\n *\n * @example\n * ```ts\n * await Application.getLastUpdateTimeAsync();\n * // 2019-07-18T21:20:16.887Z\n * ```\n * @platform android\n */\nexport async function getLastUpdateTimeAsync(): Promise<Date> {\n if (!ExpoApplication.getLastUpdateTimeAsync) {\n throw new UnavailabilityError('expo-application', 'getLastUpdateTimeAsync');\n }\n const lastUpdateTime = await ExpoApplication.getLastUpdateTimeAsync();\n return new Date(lastUpdateTime);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=Application.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Application.types.d.ts","sourceRoot":"","sources":["../src/Application.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoApplication.d.ts","sourceRoot":"","sources":["../src/ExpoApplication.ts"],"names":[],"mappings":";AACA,wBAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoApplication.web.d.ts","sourceRoot":"","sources":["../src/ExpoApplication.web.ts"],"names":[],"mappings":";;;;;;;gCAmBoC,QAAQ,IAAI,CAAC;;AAnBjD,wBAsBE"}
|
|
@@ -41,7 +41,7 @@ EX_EXPORT_METHOD_AS(getApplicationReleaseTypeAsync, getApplicationReleaseTypeAsy
|
|
|
41
41
|
EX_EXPORT_METHOD_AS(getPushNotificationServiceEnvironmentAsync, getPushNotificationServiceEnvironmentAsyncWithResolver:(EXPromiseResolveBlock)resolve rejecter:(EXPromiseRejectBlock)reject)
|
|
42
42
|
{
|
|
43
43
|
EXProvisioningProfile *mainProvisioningProfile = [EXProvisioningProfile mainProvisioningProfile];
|
|
44
|
-
resolve([mainProvisioningProfile notificationServiceEnvironment]);
|
|
44
|
+
resolve(EXNullIfNil([mainProvisioningProfile notificationServiceEnvironment]));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
- (NSDictionary *)constantsToExport
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-application",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "A universal module that gets native application information such as its ID, app name, and build version at runtime",
|
|
5
5
|
"main": "build/Application.js",
|
|
6
6
|
"types": "build/Application.d.ts",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"expo": "*"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5d900179d047d9f4d89c0b9953b7121a1f1df8a2"
|
|
40
40
|
}
|
package/src/Application.ts
CHANGED
|
@@ -135,15 +135,18 @@ export async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationRe
|
|
|
135
135
|
return await ExpoApplication.getApplicationReleaseTypeAsync();
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
// @docsMissing
|
|
139
|
+
export type PushNotificationServiceEnvironment = 'development' | 'production' | null;
|
|
140
|
+
|
|
138
141
|
// @needsAudit
|
|
139
142
|
/**
|
|
140
143
|
* Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc)
|
|
141
144
|
* service environment.
|
|
142
145
|
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`,
|
|
143
|
-
* based on the current APN environment.
|
|
146
|
+
* based on the current APN environment, or `null` on the simulator as it does not support registering with APNs.
|
|
144
147
|
* @platform ios
|
|
145
148
|
*/
|
|
146
|
-
export async function getIosPushNotificationServiceEnvironmentAsync(): Promise<
|
|
149
|
+
export async function getIosPushNotificationServiceEnvironmentAsync(): Promise<PushNotificationServiceEnvironment> {
|
|
147
150
|
if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) {
|
|
148
151
|
throw new UnavailabilityError('expo-application', 'getPushNotificationServiceEnvironmentAsync');
|
|
149
152
|
}
|
package/tsconfig.json
CHANGED