or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

index.mddocs/

Expo Application

Expo Application is a universal React Native module that provides cross-platform access to native application information including ID, name, build version, device identifiers, and installation timestamps. It abstracts platform differences between Android, iOS, and web while offering comprehensive application metadata essential for analytics, debugging, and device identification.

Package Information

  • Package Name: expo-application
  • Package Type: npm
  • Language: TypeScript
  • Installation: npx expo install expo-application
  • Platform Support: Android, iOS, Web (limited functionality on web)

Core Imports

import * as Application from 'expo-application';

Individual imports:

import { 
  applicationName,
  applicationId, 
  nativeApplicationVersion,
  getInstallationTimeAsync,
  ApplicationReleaseType 
} from 'expo-application';

For CommonJS:

const Application = require('expo-application');
const { applicationName, getInstallationTimeAsync } = require('expo-application');

Basic Usage

import * as Application from 'expo-application';
import { Platform } from 'expo-modules-core';

// Get basic app information
console.log('App Name:', Application.applicationName);
console.log('App ID:', Application.applicationId);
console.log('Version:', Application.nativeApplicationVersion);
console.log('Build:', Application.nativeBuildVersion);

// Get installation time
const installTime = await Application.getInstallationTimeAsync();
console.log('Installed:', installTime);

// Platform-specific functionality
if (Platform.OS === 'android') {
  const androidId = Application.getAndroidId();
  console.log('Android ID:', androidId);
}

if (Platform.OS === 'ios') {
  const vendorId = await Application.getIosIdForVendorAsync();
  console.log('iOS Vendor ID:', vendorId);
}

Capabilities

Application Information Constants

Basic application metadata available synchronously as constants.

/** Human-readable version displayed in app store (e.g., "2.11.0") */
const nativeApplicationVersion: string | null;

/** Internal build version used by app stores (e.g., "114") */
const nativeBuildVersion: string | null;

/** Human-readable app name displayed on device (e.g., "Expo", "Instagram") */
const applicationName: string | null;

/** Application ID (Android) or bundle ID (iOS) (e.g., "com.example.app") */
const applicationId: string | null;

Platform Support: Android and iOS return string values, web returns null.

Installation Time Information

Get timestamps for app installation and updates.

/**
 * Gets the time the app was installed onto the device
 * @returns Promise resolving to Date object of installation time
 * @platform android, ios
 */
function getInstallationTimeAsync(): Promise<Date>;

/**
 * Gets the last time the app was updated from Google Play Store
 * @returns Promise resolving to Date object of last update time
 * @platform android
 */
function getLastUpdateTimeAsync(): Promise<Date>;

Usage Example:

import * as Application from 'expo-application';
import { Platform } from 'expo-modules-core';

// Get installation time (Android, iOS)
const installDate = await Application.getInstallationTimeAsync();
console.log(`App installed: ${installDate.toLocaleDateString()}`);

// Get last update time (Android only)
if (Platform.OS === 'android') {
  const updateDate = await Application.getLastUpdateTimeAsync();
  console.log(`Last updated: ${updateDate.toLocaleDateString()}`);
}

Android Device Identification

Android-specific device and install referrer information.

/**
 * Gets Android device's ANDROID_ID (hexadecimal string unique per app/user/device)
 * @returns Android ID string
 * @throws UnavailabilityError on non-Android platforms
 * @platform android
 */
function getAndroidId(): string;

/**
 * Gets referrer URL from Google Play Store using Install Referrer API
 * @returns Promise resolving to referrer URL string
 * @throws UnavailabilityError if not available
 * @platform android
 */
function getInstallReferrerAsync(): Promise<string>;

Usage Example:

import * as Application from 'expo-application';
import { Platform } from 'expo-modules-core';

if (Platform.OS === 'android') {
  // Get Android ID
  const androidId = Application.getAndroidId();
  console.log('Android ID:', androidId); // "dd96dec43fb81c97"
  
  // Get install referrer
  const referrer = await Application.getInstallReferrerAsync();
  console.log('Install referrer:', referrer); // "utm_source=google-play&utm_medium=organic"
}

iOS Device and Environment Information

iOS-specific device identification and environment details.

/**
 * Gets iOS identifier for vendor (IDFV) - unique ID per vendor
 * @returns Promise resolving to vendor ID string or null
 * @throws UnavailabilityError if not available
 * @platform ios
 */
function getIosIdForVendorAsync(): Promise<string | null>;

/**
 * Gets iOS application release type
 * @returns Promise resolving to ApplicationReleaseType enum
 * @throws UnavailabilityError if not available
 * @platform ios
 */
function getIosApplicationReleaseTypeAsync(): Promise<ApplicationReleaseType>;

/**
 * Gets Apple Push Notification service environment
 * @returns Promise resolving to environment string or null
 * @throws UnavailabilityError if not available
 * @platform ios
 */
function getIosPushNotificationServiceEnvironmentAsync(): Promise<PushNotificationServiceEnvironment>;

Usage Example:

import * as Application from 'expo-application';
import { Platform } from 'expo-modules-core';

if (Platform.OS === 'ios') {
  // Get iOS vendor ID
  const vendorId = await Application.getIosIdForVendorAsync();
  console.log('Vendor ID:', vendorId); // "68753A44-4D6F-1226-9C60-0050E4C00067"
  
  // Get release type
  const releaseType = await Application.getIosApplicationReleaseTypeAsync();
  console.log('Release type:', releaseType); // ApplicationReleaseType.APP_STORE
  
  // Get push notification environment
  const pushEnv = await Application.getIosPushNotificationServiceEnvironmentAsync();
  console.log('Push environment:', pushEnv); // "production"
}

Types

/**
 * iOS application release type enum
 * @platform ios
 */
enum ApplicationReleaseType {
  UNKNOWN = 0,
  SIMULATOR = 1,
  ENTERPRISE = 2,
  DEVELOPMENT = 3,
  AD_HOC = 4,
  APP_STORE = 5
}

/**
 * Apple Push Notification service environment
 * Maps to aps-environment entitlement key
 * @platform ios
 */
type PushNotificationServiceEnvironment = 'development' | 'production' | null;

Error Handling

Functions throw UnavailabilityError from expo-modules-core when called on unsupported platforms:

import { Platform, UnavailabilityError } from 'expo-modules-core';

try {
  const androidId = Application.getAndroidId();
} catch (error) {
  if (error instanceof UnavailabilityError) {
    console.log('Android ID not available on this platform');
  }
}

Platform-specific Behavior:

  • Android: All functions available except iOS-specific ones
  • iOS: All functions available except Android-specific ones
  • Web: Most functionality returns null or throws UnavailabilityError

Platform Compatibility

FunctionAndroidiOSWeb
nativeApplicationVersion❌ (null)
nativeBuildVersion❌ (null)
applicationName❌ (null)
applicationId❌ (null)
getAndroidId()❌ (throws)❌ (throws)
getInstallReferrerAsync()❌ (throws)❌ (throws)
getIosIdForVendorAsync()❌ (throws)❌ (throws)
getIosApplicationReleaseTypeAsync()❌ (throws)❌ (throws)
getIosPushNotificationServiceEnvironmentAsync()❌ (throws)❌ (throws)
getInstallationTimeAsync()❌ (throws)
getLastUpdateTimeAsync()❌ (throws)❌ (throws)