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
import { AppInfo } from '@ng-native/expo';
Inject
inject(AppInfo)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 { AppInfo } from '@ng-native/expo/app-info';
@Component({
selector: 'app-about',
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 modules installed
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.