@napacitor/app-info
App information plugin wrapping the .NET MAUI AppInfo and VersionTracking APIs: app name, version, theme, version tracking, and more.
Installation
To use npm:
npm install @napacitor/app-info
To use yarn:
yarn add @napacitor/app-info
Sync native files:
npx nap sync
Usage
import { AppInfo } from '@napacitor/app-info';
// Get app information
const info = await AppInfo.getInfo();
console.log(info.name, info.version, info.build, info.theme);
// Get version tracking information
const vt = await AppInfo.getVersionTracking();
console.log('First launch ever:', vt.isFirstLaunchEver);
console.log('First launch for current version:', vt.isFirstLaunchForCurrentVersion);
console.log('Version history:', vt.versionHistory);
// Show the app info dialog (some platforms)
await AppInfo.showSettingsUI();
// Open the app's system settings
await AppInfo.openSettings();
How It Works
Wraps the .NET MAUI AppInfo.Current and VersionTracking.Default facades. getVersionTracking() calls Track() first to ensure correct counts; requestedLayoutOrientation is read via DeviceDisplay.Current.MainDisplayInfo.Orientation; openSettings() maps to AppInfo.Current.ShowSettingsUI().
Permissions
Android
No additional configuration required.
iOS
No additional configuration required.
Windows
No additional configuration required.
API
getInfo()
Gets app information.
Returns: Promise<AppInfoData>
getVersionTracking()
Gets version tracking information (calls Track() automatically on first use).
Returns: Promise<VersionTrackingData>
showSettingsUI()
Shows the app info dialog. MAUI has no built-in ShowSettingsUI; currently a no-op extension point for platforms without a built-in settings UI.
Returns: Promise<void>
openSettings()
Opens the app's system settings page (maps to AppInfo.Current.ShowSettingsUI()).
Returns: Promise<void>
Interfaces
AppInfoData
| Prop | Type | Description |
|---|---|---|
name | string | App name (display name). |
id | string | Package name (Android) / Bundle ID (iOS) / App ID (Windows). |
version | string | Version number (e.g. 1.2.3). |
build | string | Build number (e.g. 100). |
theme | string | Theme mode: light / dark / system. |
requestedLayoutOrientation | string | Requested layout orientation: portrait / landscape / unspecified. |
VersionTrackingData
| Prop | Type | Description |
|---|---|---|
currentVersion | string | Current version number. |
currentBuild | string | Current build number. |
isFirstLaunchEver | boolean | Whether this is the first install ever. |
isFirstLaunchForCurrentVersion | boolean | Whether this is the first launch of the current version. |
isFirstLaunchForCurrentBuild | boolean | Whether this is the first launch of the current build. |
previousVersion | string | Previous version number. |
previousBuild | string | Previous build number. |
versionHistory | string[] | History of versions (newest first). |
buildHistory | string[] | History of builds (newest first). |