{"id":13161,"library":"expo-application","title":"Expo Application Information Module","description":"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.","status":"active","version":"55.0.14","language":"javascript","source_language":"en","source_url":"https://github.com/expo/expo","tags":["javascript","react-native","expo","expo-application","typescript"],"install":[{"cmd":"npm install expo-application","lang":"bash","label":"npm"},{"cmd":"yarn add expo-application","lang":"bash","label":"yarn"},{"cmd":"pnpm add expo-application","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for all Expo modules, ensuring compatibility with the installed Expo SDK version.","package":"expo","optional":false}],"imports":[{"note":"Most Expo modules use named exports for their entire API surface. Access properties like `Application.applicationName`.","wrong":"import Application from 'expo-application';","symbol":"Application","correct":"import * as Application from 'expo-application';"},{"note":"For specific properties, named imports can be used directly to reduce bundle size and improve readability.","symbol":"applicationName, packageName, nativeApplicationVersion","correct":"import { applicationName, packageName, nativeApplicationVersion } from 'expo-application';"},{"note":"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.","wrong":"const { Application } = require('expo-application');","symbol":"Application (CommonJS)","correct":"const Application = require('expo-application');"}],"quickstart":{"code":"import * as Application from 'expo-application';\nimport { View, Text, StyleSheet } from 'react-native';\nimport React, { useEffect, useState } from 'react';\n\nexport default function App() {\n  const [appInfo, setAppInfo] = useState({\n    appName: 'Loading...',\n    applicationId: 'Loading...',\n    nativeApplicationVersion: 'Loading...',\n    nativeBuildVersion: 'Loading...'\n  });\n\n  useEffect(() => {\n    async function getApplicationInfo() {\n      const name = Application.applicationName ?? 'N/A';\n      const id = Application.applicationId ?? 'N/A';\n      const nativeVersion = Application.nativeApplicationVersion ?? 'N/A';\n      const buildVersion = Application.nativeBuildVersion ?? 'N/A';\n\n      setAppInfo({\n        appName: name,\n        applicationId: id,\n        nativeApplicationVersion: nativeVersion,\n        nativeBuildVersion: buildVersion,\n      });\n    }\n    getApplicationInfo();\n  }, []);\n\n  return (\n    <View style={styles.container}>\n      <Text style={styles.title}>Application Info:</Text>\n      <Text>App Name: {appInfo.appName}</Text>\n      <Text>Application ID: {appInfo.applicationId}</Text>\n      <Text>Native Version: {appInfo.nativeApplicationVersion}</Text>\n      <Text>Build Version: {appInfo.nativeBuildVersion}</Text>\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: '#fff',\n    alignItems: 'center',\n    justifyContent: 'center',\n    padding: 20,\n  },\n  title: {\n    fontSize: 24,\n    fontWeight: 'bold',\n    marginBottom: 10,\n  },\n});","lang":"typescript","description":"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."},"warnings":[{"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`.","message":"When 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`).","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"Accessing `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.","severity":"breaking","affected_versions":">=48.0.0"},{"fix":"Use `Platform.OS === 'android'` conditionals to gate access to Android-only properties and methods. Provide fallback logic or UI for other platforms.","message":"Many 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"There'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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"`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.","severity":"breaking","affected_versions":">=46.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"The `expo-application` module was not correctly imported, linked, or the Metro bundler cache is stale.","error":"TypeError: undefined is not an object (evaluating 'expo_application.applicationName')"},{"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.","cause":"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.","error":"Invariant Violation: `new NativeEventEmitter()` requires a non-null argument."},{"fix":"Always wrap platform-specific method calls with `Platform.OS` checks. For example, `if (Platform.OS === 'android') { const time = await Application.getInstallationTimeAsync(); }`.","cause":"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).","error":"Error: Call to function 'ExpoApplication.getInstallationTimeAsync' has been rejected. Details: This function is not available on this platform."},{"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.","cause":"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.","error":"Constants.nativeAppVersion shows wrong value"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}