Hierarchy

  • Device

Methods

  • Provides device informations.

    Example:

    let deviceInfos = await Eitri.device.getInfos()
    console.log(deviceInfos)
    // Example output from this console.log:
    {
    "android": {
    "apiLevel": 33
    },
    "brand": "samsung",
    "model": "sm-a515f",
    "platform": "android",
    "osVersion": "13"
    }

    Compatibility Control

    • API LEVEL 28 - Functionality added

    Returns Promise<DeviceInfosOutput>

  • Provides the device region as reported by independent sources. The sources can disagree (e.g. while roaming, or when the user picks a locale from another country), so choose the one that fits your use case instead of assuming they match.

    Example:

    let region = await Eitri.device.getRegion()
    console.log(region)
    // Example output from this console.log on Android:
    {
    "sim": "BR",
    "network": "BR",
    "locale": "BR",
    "timezone": "America/Sao_Paulo"
    }

    sim and network are always null on iOS. Check DeviceRegionOutput for details on each source.

    Compatibility Control

    • API LEVEL 39 - Functionality added

    Returns Promise<DeviceRegionOutput>

Generated using TypeDoc