expo-application
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -0,7 +1,75 @@ | ||
/** | ||
* The human-readable version of the native application that may be displayed in the app store. | ||
* This is the `Info.plist` value for `CFBundleShortVersionString` on iOS and the version name set | ||
* by `version` in `app.json` on Android at the time the native app was built. | ||
* On web, this value is `null`. | ||
* - E.g., `"2.11.0"` | ||
*/ | ||
export declare const nativeApplicationVersion: string | null; | ||
/** | ||
* The internal build version of the native application that the app store may use to distinguish | ||
* between different binaries. This is the `Info.plist` value for `CFBundleVersion` on iOS (set with | ||
* `ios.buildNumber` value in `app.json` in a standalone app) and the version code set by | ||
* `android.versionCode` in `app.json` on Android at the time the native app was built. On web, this | ||
* value is `null`. The return type on Android and iOS is `string`. | ||
* - E.g., iOS: `"2.11.0"`, Android: `"114"` | ||
*/ | ||
export declare const nativeBuildVersion: string | null; | ||
/** | ||
* The human-readable name of the application that is displayed with the app's icon on the device's | ||
* home screen or desktop. On Android and iOS, this value is a `string` unless the name could not be | ||
* retrieved, in which case this value will be `null`. On web this value is `null`. | ||
* - E.g., `"Expo"`, `"Yelp"`, `"Instagram"` | ||
*/ | ||
export declare const applicationName: string | null; | ||
/** | ||
* The ID of the application. On Android, this is the application ID. On iOS, this is the bundle ID. | ||
* On web, this is `null`. | ||
* - E.g., `"com.cocoacasts.scribbles"`, `"com.apple.Pages"` | ||
*/ | ||
export declare const applicationId: string | null; | ||
/** | ||
* **Android only.** The value of [`Settings.Secure.ANDROID_ID`](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). | ||
* This is a hexadecimal `string` unique to each combination of app-signing key, user, and device. | ||
* The value may change if a factory reset is performed on the device or if an APK signing key changes. | ||
* For more information about how the platform handles `ANDROID_ID` in Android 8.0 (API level 26) | ||
* and higher, see [Android 8.0 Behavior Changes](https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all). | ||
* On iOS and web, this value is `null`. | ||
* > In versions of the platform lower than Android 8.0 (API level 26), this value remains constant | ||
* > for the lifetime of the user's device. See the [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID) | ||
* > official docs for more information. | ||
* - E.g., `"dd96dec43fb81c97"` | ||
*/ | ||
export declare const androidId: string | null; | ||
/** | ||
* **Android only.** Gets the referrer URL of the installed app with the [`Install Referrer API`](https://developer.android.com/google/play/installreferrer) | ||
* from the Google Play Store. In practice, the referrer URL may not be a complete, absolute URL. | ||
* @return A `Promise` that fulfills with a `string` of the referrer URL of the installed app. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallReferrerAsync(); | ||
* // "utm_source=google-play&utm_medium=organic" | ||
* ``` | ||
*/ | ||
export declare function getInstallReferrerAsync(): Promise<string>; | ||
/** | ||
* **iOS only.** Gets the iOS "identifier for vendor" ([IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)) | ||
* value, a string ID that uniquely identifies a device to the app’s vendor. This method may | ||
* sometimes return `nil`, in which case wait and call the method again later. This might happen | ||
* when the device has been restarted before the user has unlocked the device. | ||
* | ||
* The OS will change the vendor identifier if all apps from the current app's vendor have been | ||
* uninstalled. | ||
* | ||
* @return A `Promise` that fulfills with a `string` specifying the app's vendor ID. Apps from the | ||
* same vendor will return the same ID. See Apple's documentation for more information about the | ||
* vendor ID's semantics. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getIosIdForVendorAsync(); | ||
* // "68753A44-4D6F-1226-9C60-0050E4C00067" | ||
* ``` | ||
*/ | ||
export declare function getIosIdForVendorAsync(): Promise<string | null>; | ||
@@ -16,5 +84,43 @@ export declare enum ApplicationReleaseType { | ||
} | ||
/** | ||
* **iOS only.** Gets the iOS application release type. | ||
* @return Returns a promise which fulfills with an [`ApplicationReleaseType`](#applicationreleasetype). | ||
*/ | ||
export declare function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType>; | ||
/** | ||
* **iOS only.** Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc) | ||
* service environment. | ||
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`, | ||
* based on the current APN environment. | ||
*/ | ||
export declare function getIosPushNotificationServiceEnvironmentAsync(): Promise<string>; | ||
/** | ||
* Gets the time the app was installed onto the device, not counting subsequent updates. If the app | ||
* is uninstalled and reinstalled, this method returns the time the app was reinstalled. | ||
* - On iOS, this method uses the [`NSFileCreationDate`](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc) | ||
* of the app's document root directory. | ||
* - On Android, this method uses [`PackageInfo.firstInstallTime`](https://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime). | ||
* - On web, this method returns `null`. | ||
* | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the time the app | ||
* was installed on the device. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallationTimeAsync(); | ||
* // 2019-07-18T18:08:26.121Z | ||
* ``` | ||
*/ | ||
export declare function getInstallationTimeAsync(): Promise<Date>; | ||
/** | ||
* **Android only.** Gets the last time the app was updated from the Google Play Store. | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the last time | ||
* the app was updated via the Google Play Store). | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getLastUpdateTimeAsync(); | ||
* // 2019-07-18T21:20:16.887Z | ||
* ``` | ||
*/ | ||
export declare function getLastUpdateTimeAsync(): Promise<Date>; |
import { UnavailabilityError } from '@unimodules/core'; | ||
import ExpoApplication from './ExpoApplication'; | ||
// @needsAudit | ||
/** | ||
* The human-readable version of the native application that may be displayed in the app store. | ||
* This is the `Info.plist` value for `CFBundleShortVersionString` on iOS and the version name set | ||
* by `version` in `app.json` on Android at the time the native app was built. | ||
* On web, this value is `null`. | ||
* - E.g., `"2.11.0"` | ||
*/ | ||
export const nativeApplicationVersion = ExpoApplication | ||
? ExpoApplication.nativeApplicationVersion || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The internal build version of the native application that the app store may use to distinguish | ||
* between different binaries. This is the `Info.plist` value for `CFBundleVersion` on iOS (set with | ||
* `ios.buildNumber` value in `app.json` in a standalone app) and the version code set by | ||
* `android.versionCode` in `app.json` on Android at the time the native app was built. On web, this | ||
* value is `null`. The return type on Android and iOS is `string`. | ||
* - E.g., iOS: `"2.11.0"`, Android: `"114"` | ||
*/ | ||
export const nativeBuildVersion = ExpoApplication | ||
? ExpoApplication.nativeBuildVersion || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The human-readable name of the application that is displayed with the app's icon on the device's | ||
* home screen or desktop. On Android and iOS, this value is a `string` unless the name could not be | ||
* retrieved, in which case this value will be `null`. On web this value is `null`. | ||
* - E.g., `"Expo"`, `"Yelp"`, `"Instagram"` | ||
*/ | ||
export const applicationName = ExpoApplication | ||
? ExpoApplication.applicationName || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The ID of the application. On Android, this is the application ID. On iOS, this is the bundle ID. | ||
* On web, this is `null`. | ||
* - E.g., `"com.cocoacasts.scribbles"`, `"com.apple.Pages"` | ||
*/ | ||
export const applicationId = ExpoApplication | ||
? ExpoApplication.applicationId || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* **Android only.** The value of [`Settings.Secure.ANDROID_ID`](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). | ||
* This is a hexadecimal `string` unique to each combination of app-signing key, user, and device. | ||
* The value may change if a factory reset is performed on the device or if an APK signing key changes. | ||
* For more information about how the platform handles `ANDROID_ID` in Android 8.0 (API level 26) | ||
* and higher, see [Android 8.0 Behavior Changes](https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all). | ||
* On iOS and web, this value is `null`. | ||
* > In versions of the platform lower than Android 8.0 (API level 26), this value remains constant | ||
* > for the lifetime of the user's device. See the [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID) | ||
* > official docs for more information. | ||
* - E.g., `"dd96dec43fb81c97"` | ||
*/ | ||
export const androidId = ExpoApplication ? ExpoApplication.androidId || null : null; | ||
// @needsAudit | ||
/** | ||
* **Android only.** Gets the referrer URL of the installed app with the [`Install Referrer API`](https://developer.android.com/google/play/installreferrer) | ||
* from the Google Play Store. In practice, the referrer URL may not be a complete, absolute URL. | ||
* @return A `Promise` that fulfills with a `string` of the referrer URL of the installed app. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallReferrerAsync(); | ||
* // "utm_source=google-play&utm_medium=organic" | ||
* ``` | ||
*/ | ||
export async function getInstallReferrerAsync() { | ||
@@ -22,2 +77,22 @@ if (!ExpoApplication.getInstallReferrerAsync) { | ||
} | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the iOS "identifier for vendor" ([IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)) | ||
* value, a string ID that uniquely identifies a device to the app’s vendor. This method may | ||
* sometimes return `nil`, in which case wait and call the method again later. This might happen | ||
* when the device has been restarted before the user has unlocked the device. | ||
* | ||
* The OS will change the vendor identifier if all apps from the current app's vendor have been | ||
* uninstalled. | ||
* | ||
* @return A `Promise` that fulfills with a `string` specifying the app's vendor ID. Apps from the | ||
* same vendor will return the same ID. See Apple's documentation for more information about the | ||
* vendor ID's semantics. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getIosIdForVendorAsync(); | ||
* // "68753A44-4D6F-1226-9C60-0050E4C00067" | ||
* ``` | ||
*/ | ||
export async function getIosIdForVendorAsync() { | ||
@@ -29,2 +104,3 @@ if (!ExpoApplication.getIosIdForVendorAsync) { | ||
} | ||
// @docsMissing | ||
export var ApplicationReleaseType; | ||
@@ -39,2 +115,7 @@ (function (ApplicationReleaseType) { | ||
})(ApplicationReleaseType || (ApplicationReleaseType = {})); | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the iOS application release type. | ||
* @return Returns a promise which fulfills with an [`ApplicationReleaseType`](#applicationreleasetype). | ||
*/ | ||
export async function getIosApplicationReleaseTypeAsync() { | ||
@@ -46,2 +127,9 @@ if (!ExpoApplication.getApplicationReleaseTypeAsync) { | ||
} | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc) | ||
* service environment. | ||
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`, | ||
* based on the current APN environment. | ||
*/ | ||
export async function getIosPushNotificationServiceEnvironmentAsync() { | ||
@@ -53,2 +141,20 @@ if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) { | ||
} | ||
// @needsAudit | ||
/** | ||
* Gets the time the app was installed onto the device, not counting subsequent updates. If the app | ||
* is uninstalled and reinstalled, this method returns the time the app was reinstalled. | ||
* - On iOS, this method uses the [`NSFileCreationDate`](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc) | ||
* of the app's document root directory. | ||
* - On Android, this method uses [`PackageInfo.firstInstallTime`](https://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime). | ||
* - On web, this method returns `null`. | ||
* | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the time the app | ||
* was installed on the device. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallationTimeAsync(); | ||
* // 2019-07-18T18:08:26.121Z | ||
* ``` | ||
*/ | ||
export async function getInstallationTimeAsync() { | ||
@@ -61,2 +167,14 @@ if (!ExpoApplication.getInstallationTimeAsync) { | ||
} | ||
// @needsAudit | ||
/** | ||
* **Android only.** Gets the last time the app was updated from the Google Play Store. | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the last time | ||
* the app was updated via the Google Play Store). | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getLastUpdateTimeAsync(); | ||
* // 2019-07-18T21:20:16.887Z | ||
* ``` | ||
*/ | ||
export async function getLastUpdateTimeAsync() { | ||
@@ -63,0 +181,0 @@ if (!ExpoApplication.getLastUpdateTimeAsync) { |
@@ -11,2 +11,6 @@ # Changelog | ||
## 3.1.1 — 2021-04-09 | ||
_This version does not introduce any user-facing changes._ | ||
## 3.1.0 — 2021-03-10 | ||
@@ -13,0 +17,0 @@ |
{ | ||
"name": "expo-application", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "A universal module that gets native application information such as its ID, app name, and build version at runtime", | ||
@@ -35,3 +35,3 @@ "main": "build/Application.js", | ||
}, | ||
"gitHead": "20fd5d772b3909444cf5c981845625801fe51e78" | ||
"gitHead": "0c439b0ef7c61d86cd37cb5c35992114bafa91fd" | ||
} |
@@ -5,16 +5,75 @@ import { UnavailabilityError } from '@unimodules/core'; | ||
// @needsAudit | ||
/** | ||
* The human-readable version of the native application that may be displayed in the app store. | ||
* This is the `Info.plist` value for `CFBundleShortVersionString` on iOS and the version name set | ||
* by `version` in `app.json` on Android at the time the native app was built. | ||
* On web, this value is `null`. | ||
* - E.g., `"2.11.0"` | ||
*/ | ||
export const nativeApplicationVersion: string | null = ExpoApplication | ||
? ExpoApplication.nativeApplicationVersion || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The internal build version of the native application that the app store may use to distinguish | ||
* between different binaries. This is the `Info.plist` value for `CFBundleVersion` on iOS (set with | ||
* `ios.buildNumber` value in `app.json` in a standalone app) and the version code set by | ||
* `android.versionCode` in `app.json` on Android at the time the native app was built. On web, this | ||
* value is `null`. The return type on Android and iOS is `string`. | ||
* - E.g., iOS: `"2.11.0"`, Android: `"114"` | ||
*/ | ||
export const nativeBuildVersion: string | null = ExpoApplication | ||
? ExpoApplication.nativeBuildVersion || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The human-readable name of the application that is displayed with the app's icon on the device's | ||
* home screen or desktop. On Android and iOS, this value is a `string` unless the name could not be | ||
* retrieved, in which case this value will be `null`. On web this value is `null`. | ||
* - E.g., `"Expo"`, `"Yelp"`, `"Instagram"` | ||
*/ | ||
export const applicationName: string | null = ExpoApplication | ||
? ExpoApplication.applicationName || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* The ID of the application. On Android, this is the application ID. On iOS, this is the bundle ID. | ||
* On web, this is `null`. | ||
* - E.g., `"com.cocoacasts.scribbles"`, `"com.apple.Pages"` | ||
*/ | ||
export const applicationId: string | null = ExpoApplication | ||
? ExpoApplication.applicationId || null | ||
: null; | ||
// @needsAudit | ||
/** | ||
* **Android only.** The value of [`Settings.Secure.ANDROID_ID`](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). | ||
* This is a hexadecimal `string` unique to each combination of app-signing key, user, and device. | ||
* The value may change if a factory reset is performed on the device or if an APK signing key changes. | ||
* For more information about how the platform handles `ANDROID_ID` in Android 8.0 (API level 26) | ||
* and higher, see [Android 8.0 Behavior Changes](https://developer.android.com/about/versions/oreo/android-8.0-changes.html#privacy-all). | ||
* On iOS and web, this value is `null`. | ||
* > In versions of the platform lower than Android 8.0 (API level 26), this value remains constant | ||
* > for the lifetime of the user's device. See the [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID) | ||
* > official docs for more information. | ||
* - E.g., `"dd96dec43fb81c97"` | ||
*/ | ||
export const androidId: string | null = ExpoApplication ? ExpoApplication.androidId || null : null; | ||
// @needsAudit | ||
/** | ||
* **Android only.** Gets the referrer URL of the installed app with the [`Install Referrer API`](https://developer.android.com/google/play/installreferrer) | ||
* from the Google Play Store. In practice, the referrer URL may not be a complete, absolute URL. | ||
* @return A `Promise` that fulfills with a `string` of the referrer URL of the installed app. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallReferrerAsync(); | ||
* // "utm_source=google-play&utm_medium=organic" | ||
* ``` | ||
*/ | ||
export async function getInstallReferrerAsync(): Promise<string> { | ||
@@ -27,2 +86,22 @@ if (!ExpoApplication.getInstallReferrerAsync) { | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the iOS "identifier for vendor" ([IDFV](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)) | ||
* value, a string ID that uniquely identifies a device to the app’s vendor. This method may | ||
* sometimes return `nil`, in which case wait and call the method again later. This might happen | ||
* when the device has been restarted before the user has unlocked the device. | ||
* | ||
* The OS will change the vendor identifier if all apps from the current app's vendor have been | ||
* uninstalled. | ||
* | ||
* @return A `Promise` that fulfills with a `string` specifying the app's vendor ID. Apps from the | ||
* same vendor will return the same ID. See Apple's documentation for more information about the | ||
* vendor ID's semantics. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getIosIdForVendorAsync(); | ||
* // "68753A44-4D6F-1226-9C60-0050E4C00067" | ||
* ``` | ||
*/ | ||
export async function getIosIdForVendorAsync(): Promise<string | null> { | ||
@@ -35,2 +114,3 @@ if (!ExpoApplication.getIosIdForVendorAsync) { | ||
// @docsMissing | ||
export enum ApplicationReleaseType { | ||
@@ -45,2 +125,7 @@ UNKNOWN = 0, | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the iOS application release type. | ||
* @return Returns a promise which fulfills with an [`ApplicationReleaseType`](#applicationreleasetype). | ||
*/ | ||
export async function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType> { | ||
@@ -53,2 +138,9 @@ if (!ExpoApplication.getApplicationReleaseTypeAsync) { | ||
// @needsAudit | ||
/** | ||
* **iOS only.** Gets the current [Apple Push Notification (APN)](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment?language=objc) | ||
* service environment. | ||
* @return Returns a promise fulfilled with the string, either `'development'` or `'production'`, | ||
* based on the current APN environment. | ||
*/ | ||
export async function getIosPushNotificationServiceEnvironmentAsync(): Promise<string> { | ||
@@ -61,2 +153,20 @@ if (!ExpoApplication.getPushNotificationServiceEnvironmentAsync) { | ||
// @needsAudit | ||
/** | ||
* Gets the time the app was installed onto the device, not counting subsequent updates. If the app | ||
* is uninstalled and reinstalled, this method returns the time the app was reinstalled. | ||
* - On iOS, this method uses the [`NSFileCreationDate`](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc) | ||
* of the app's document root directory. | ||
* - On Android, this method uses [`PackageInfo.firstInstallTime`](https://developer.android.com/reference/android/content/pm/PackageInfo.html#firstInstallTime). | ||
* - On web, this method returns `null`. | ||
* | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the time the app | ||
* was installed on the device. | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getInstallationTimeAsync(); | ||
* // 2019-07-18T18:08:26.121Z | ||
* ``` | ||
*/ | ||
export async function getInstallationTimeAsync(): Promise<Date> { | ||
@@ -70,2 +180,14 @@ if (!ExpoApplication.getInstallationTimeAsync) { | ||
// @needsAudit | ||
/** | ||
* **Android only.** Gets the last time the app was updated from the Google Play Store. | ||
* @return Returns a `Promise` that fulfills with a `Date` object that specifies the last time | ||
* the app was updated via the Google Play Store). | ||
* | ||
* # Example | ||
* ```ts | ||
* await Application.getLastUpdateTimeAsync(); | ||
* // 2019-07-18T21:20:16.887Z | ||
* ``` | ||
*/ | ||
export async function getLastUpdateTimeAsync(): Promise<Date> { | ||
@@ -72,0 +194,0 @@ if (!ExpoApplication.getLastUpdateTimeAsync) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58492
561