App info
AppInfo reports the app's own version and build, and the device it is running on, bound to
expo-application and expo-device.
import { AppInfo } from '@ng-native/expo';
inject(AppInfo)Platforms. Available on macOS, Linux (brand and manufacturer from the firmware, or null), iPadOS, iPhone and Android. Absent on Web host, where available() is false.
These are constants, read once, rather than signals: none of them changes while the app runs. Anything the platform does not say is null, and so is everything from a module that is not installed.
Install
npx expo install expo-application expo-deviceimport { AppInfo } from '@ng-native/expo/app-info';The smallest useful example
import { Component, inject } from '@angular/core';
import { Text } from '@ng-native/components';
import { AppInfo } from '@ng-native/expo/app-info';
@Component({
selector: 'app-about',
imports: [Text],
template: `<text>{{ info.version }} ({{ info.build }}) on {{ info.device.model }}</text>`,
})
export class About {
protected readonly info = inject(AppInfo);
}What it reports
From expo-application:
version- the version people see:CFBundleShortVersionStringon iOS, Android'sversionName.build- the build number:CFBundleVersionon iOS, Android'sversionCode.id- the bundle identifier on iOS, the package name on Android.name- the name under the icon.
From expo-device, on device:
model-iPhone 17 Pro,Pixel 9.brandos-iOS,iPadOS,Android.osVersionphysical- false in a simulator or emulator.type-'phone','tablet','desktop','tv'or'unknown', null if the platform did not say.
Without the module
On iOS and Android, a missing expo-application and expo-device - never installed, or installed
without the app being rebuilt since - leaves the service made, so injecting it does not throw. A
call, or a read of a value only the module knows, throws a MissingModuleError. Its message names
the module and the commands that fix it; see
Using a module.
On the web, and in a test that provides no fake, version, build, id and name are all null
without expo-application. device is every field null and physical null without expo-device.
Each module is independent: installing only one still fills in what it can.
Reference
AppInfoservice@ng-native/expoimport { AppInfo } from '@ng-native/expo';No public members.