react-native-device-info
Device Info is a library for using DeviceInfo React Native in React Native for Vega apps. The library provides device-related information for React Native for Vega apps.
Installation
To use the package, add the JavaScript library dependency in your app's package.json
file.
"dependencies": {
...
"@amazon-devices/react-native-device-info": "~2.0.0"
}
Examples
import DeviceInfo from '@amazon-devices/react-native-device-info';
// or ES6+ destructured imports
import { getBaseOs, getBaseOsSync } from '@amazon-devices/react-native-device-info';
const baseOsSync = getBaseOsSync();
const baseOs = await getBaseOs();
API reference
Vega only supports the APIs mentioned in this document. Many APIs from react-native-device-info APIs are platform-specific. If there is no implementation for a platform, then the "default" return values you will receive are unknown
for string, -1
for number, and false
for boolean. Arrays and Objects will be empty ([]
and {}
respectively).
Most of the APIs return a Promise but also have a corresponding API with Sync
on the end that operates synchronously. For example, you may prefer to call getBaseOsSync()
during your app bootstrap to avoid async calls during the first parts of app startup.
Note: The values shown in the examples are for informational purposes only and don't represent the actual output.
getBaseOs()
The base OS build the product is based on.
Examples
DeviceInfo.getBaseOs().then((baseOs) => {
// "Kepler"
});
getFirstInstallTime()
Gets the time at which the app was first installed, in milliseconds.
Examples
DeviceInfo.getFirstInstallTime().then((firstInstallTime) => {
// 1517681764528
});
getInstallerPackageName()
The internal value used by the underlying source control to represent this build.
Examples
DeviceInfo.getInstallerPackageName().then((installerPackageName) => {
// "com.amazon.venezia"
});
getManufacturer()
Gets the device manufacturer.
Examples
DeviceInfo.getManufacturer().then((manufacturer) => {
// "Amazon"
});
getLastUpdateTime()
Gets the time at which the app was last updated, in milliseconds.
Examples
DeviceInfo.getLastUpdateTime().then((lastUpdateTime) => {
// 1517681764992
});
getUserAgent()
Gets the device User Agent.
Examples
DeviceInfo.getUserAgent().then((userAgent) => {
// "Kepler/1.1 (Linux; AFTCA002)"
});
Known issue
getuserAgent
may not return a value in the Vega Virtual Device, but returns a value on the Fire TV Stick.
getApplicationName()
Gets the application name.
Examples
let appName = DeviceInfo.getApplicationName();
// "AwesomeApp"
getVersion()
Gets the application version.
Examples
let version = DeviceInfo.getVersion();
// "1.0.0"
getModel()
Gets the device model.
Examples
let model = DeviceInfo.getModel();
// AFTCA001
getSystemName()
Gets the device OS name.
Examples
let systemName = DeviceInfo.getSystemName();
// "Kepler"
getSystemVersion()
Gets the device OS version.
Examples
let systemVersion = DeviceInfo.getSystemVersion();
// "1.1"
getBundleId()
Gets the application bundle identifier.
Examples
let bundleId = DeviceInfo.getBundleId();
// "com.example.awesomeApp"
getDeviceType()
Returns the device's type as a string
Examples
let type = DeviceInfo.getDeviceType();
// 'TV'
// unknown
getDeviceId()
Gets the device ID.
Examples
let deviceId = DeviceInfo.getDeviceId();
// AFTCA001
Supported versions
Package name | Amazon NPM library version | Vega OS build number | Vega SDK version | Release notes |
---|---|---|---|---|
@amazon-devices/react-native-device-info |
2.1.0+10.11.0 | OS 1.1 (201010438050) |
0.20 |
Related topics
Last updated: Oct 02, 2025