Registry / web-framework / expo-application

expo-application

JSON →
library55.0.14jsnpmunverified

expo-application is a universal module within the Expo SDK that provides runtime access to native application metadata, such as the app's ID, human-readable name, and build version. It operates seamlessly across iOS, Android, and web platforms, although some properties are platform-specific. Expo SDKs, which include expo-application, are typically released three times per year, aligning with React Native's release cadence, with the current stable version being 55.0.14. This module differentiates itself by offering a unified JavaScript API for retrieving essential app identification data without requiring direct native code interaction, simplifying tasks like displaying version numbers to users, facilitating debugging, or integrating with analytics platforms. It is a fundamental building block for any Expo project needing to programmatically query its own identity.

npm install expo-application
INSTALL
IMPORT
SIG · EXPO-APPLICATION
E
expo-application
web-frameworkjavascriptv55.0.14
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Application
import * as Application from 'expo-application';
import Application from 'expo-application';
Most Expo modules use named exports for their entire API surface. Access properties like `Application.applicationName`.
applicationName, packageName, nativeApplicationVersion
import { applicationName, packageName, nativeApplicationVersion } from 'expo-application';
For specific properties, named imports can be used directly to reduce bundle size and improve readability.
Application (CommonJS)
const Application = require('expo-application');
const { Application } = require('expo-application');
While modern Expo projects primarily use ESM, CommonJS `require` is available for older Node.js environments or specific build setups, importing the entire module object.

Demonstrates how to import and use expo-application to retrieve and display core application information such as name, ID, and version, in a functional React Native component.

import * as Application from 'expo-application'; import { View, Text, StyleSheet } from 'react-native'; import React, { useEffect, useState } from 'react'; export default function App() { const [appInfo, setAppInfo] = useState({ appName: 'Loading...', applicationId: 'Loading...', nativeApplicationVersion: 'Loading...', nativeBuildVersion: 'Loading...' }); useEffect(() => { async function getApplicationInfo() { const name = Application.applicationName ?? 'N/A'; const id = Application.applicationId ?? 'N/A'; const nativeVersion = Application.nativeApplicationVersion ?? 'N/A'; const buildVersion = Application.nativeBuildVersion ?? 'N/A'; setAppInfo({ appName: name, applicationId: id, nativeApplicationVersion: nativeVersion, nativeBuildVersion: buildVersion, }); } getApplicationInfo(); }, []); return ( <View style={styles.container}> <Text style={styles.title}>Application Info:</Text> <Text>App Name: {appInfo.appName}</Text> <Text>Application ID: {appInfo.applicationId}</Text> <Text>Native Version: {appInfo.nativeApplicationVersion}</Text> <Text>Build Version: {appInfo.nativeBuildVersion}</Text> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', padding: 20, }, title: { fontSize: 24, fontWeight: 'bold', marginBottom: 10, }, });
Debug
Known issues
gotchaWhen running your app in Expo Go, `expo-application` properties (like `applicationName`, `applicationId`, `nativeApplicationVersion`) will return information about the Expo Go app itself, not your standalone application. To get your app's actual details, you must create a standalone build (e.g., with EAS Build or `npx expo prebuild`).
fix
Always test `expo-application` in a development build or a standalone production build to see your app's actual metadata. For debugging purposes in Expo Go, you might use `Constants.manifest.version` or `Constants.expoConfig.version` for basic version info from `app.json`.
affects: >=1.0.0
breakingAccessing `Application.androidId` on Android 13 (SDK 33) and higher requires the `com.google.android.gms.permission.AD_ID` permission in your `AndroidManifest.xml`. Without it, `androidId` may return `null` or throw an error.
fix
For projects using Expo SDK 48 or higher targeting Android 13+, ensure `android.permissions` in your `app.json` or `app.config.js` includes `'com.google.android.gms.permission.AD_ID'`. You may also need to update Google Play Services in your project.
affects: >=48.0.0
gotchaMany properties, such as `Application.installTime`, `Application.lastUpdateTime`, and `Application.installReferrer`, are Android-specific and will return `null` or be unavailable on iOS and web platforms. Always check `Platform.OS` before attempting to access platform-specific properties or methods.
fix
Use `Platform.OS === 'android'` conditionals to gate access to Android-only properties and methods. Provide fallback logic or UI for other platforms.
affects: >=1.0.0
gotchaThere's a distinction between `Application.nativeApplicationVersion` and `Application.nativeBuildVersion`. `nativeApplicationVersion` corresponds to the user-facing version (e.g., `versionName` on Android, `CFBundleShortVersionString` on iOS), while `nativeBuildVersion` is the internal developer-facing build number (e.g., `versionCode` on Android, `CFBundleVersion` on iOS). Confusing these can lead to incorrect version displays or build issues.
fix
Understand and use the appropriate property for your needs. `nativeApplicationVersion` is for display to users, `nativeBuildVersion` is for app store uploads and internal tracking.
affects: >=1.0.0
breaking`Application.installReferrer` was effectively removed for iOS in Expo SDK 46. While it was always an Android-specific concept, attempting to access it on iOS in older versions might have resulted in `null`; in SDK 46 and newer, any cross-platform assumption of its availability could break.
fix
Ensure `Application.installReferrer` is only accessed on Android, typically guarded by `Platform.OS === 'android'`. Review usage if upgrading from SDK versions prior to 46.
affects: >=46.0.0
Errors
Common errors & fixes
TypeError: undefined is not an object (evaluating 'expo_application.applicationName')
The `expo-application` module was not correctly imported, linked, or the Metro bundler cache is stale.
fix
Ensure `import * as Application from 'expo-application';` is at the top of your file. Clear the Metro bundler cache with `npx expo start --clear` or `expo start -c`, and if in a bare workflow, ensure native modules are correctly autolinked or manually linked, and rebuild the native app.
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
This error typically indicates that a native module expected by an Expo package is not properly linked or available in your native project, especially in bare workflows or after an SDK upgrade.
fix
After installing new Expo packages or upgrading your SDK, run `npx expo install --fix` to update dependencies, then `npx expo prebuild --clean` (if using bare workflow) to regenerate native projects, and rebuild your native app (e.g., `npx expo run:ios`, `npx expo run:android`). Clear Node.js and npm/Yarn caches as well.
Error: Call to function 'ExpoApplication.getInstallationTimeAsync' has been rejected. Details: This function is not available on this platform.
Attempting to call a platform-specific method (`getInstallationTimeAsync`, `getAndroidId`, etc.) on an unsupported platform (e.g., calling an Android-only method on iOS or web).
fix
Always wrap platform-specific method calls with `Platform.OS` checks. For example, `if (Platform.OS === 'android') { const time = await Application.getInstallationTimeAsync(); }`.
Constants.nativeAppVersion shows wrong value
This usually happens when running the app in the Expo Go client, which displays the version of the Expo Go app itself, not your project's version.
fix
To see your application's specific version, you must build a development build or a standalone binary (APK/IPA). Alternatively, for `app.json` defined versions, `Constants.expoConfig.version` can be used as a workaround for managed workflow within Expo Go.
Upgrade
Version history
55.0.14latest on npm
Audit
Dependencies
exporequiredPeer dependency required for all Expo modules, ensuring compatibility with the installed Expo SDK version.
Agent activity
2 hits · last 30 days
node
2
Resources
expo-application — npm install expo-application · libregistry