How to use the react-native-device-info.getDeviceId function in react-native-device-info

To help you get started, we’ve selected a few react-native-device-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mongrov / roverz / example / src / app / config.js View on Github external
ModuleConfig.gaTrackingId = 'UA-110176262-1';
    ModuleConfig.init();
    ModuleConfig.setLogo(require('../images/logo.png'));  // eslint-disable-line global-require
    ModuleConfig.setNavLogo(require('../images/logo.png'));  // eslint-disable-line global-require
    ModuleConfig.setFilterRooms([
      'support', 'exceptions',
    ]);

    // set user agent
    let ua = ModuleConfig.appName;
    try {
      // Build user agent string
      ua = `${ModuleConfig.appName} ` +
        `${DeviceInfo.getVersion()}; ${DeviceInfo.getSystemName()}  ` +
        `${DeviceInfo.getSystemVersion()}; ${DeviceInfo.getBrand()} ` +
        `${DeviceInfo.getDeviceId()}`;
    } catch (e) {
      // do nothing
    }
    AppAPI.setUserAgent(ua);
  },
github celo-org / celo-monorepo / packages / react-components / analytics / CeloAnalytics.tsx View on Github external
async function getDeviceInfo() {
  return {
    AppName: DeviceInfo.getApplicationName(),
    Brand: DeviceInfo.getBrand(),
    BuildNumber: DeviceInfo.getBuildNumber(),
    BundleId: DeviceInfo.getBundleId(),
    Carrier: await DeviceInfo.getCarrier(),
    DeviceId: DeviceInfo.getDeviceId(),
    DeviceName: await DeviceInfo.getDeviceName(), // NOTE(nitya) this might contain PII, monitor
    FirstInstallTime: await DeviceInfo.getFirstInstallTime(),
    FontScale: await DeviceInfo.getFontScale(),
    FreeDiskStorage: await DeviceInfo.getFreeDiskStorage(),
    InstallReferrer: await DeviceInfo.getInstallReferrer(),
    InstanceID: await DeviceInfo.getInstanceId(),
    LastUpdateTime: await DeviceInfo.getLastUpdateTime(),
    Manufacturer: await DeviceInfo.getManufacturer(),
    MaxMemory: await DeviceInfo.getMaxMemory(),
    Model: DeviceInfo.getModel(),
    ReadableVersion: DeviceInfo.getReadableVersion(),
    SerialNumber: await DeviceInfo.getSerialNumber(),
    SystemName: DeviceInfo.getSystemName(),
    SystemVersion: DeviceInfo.getSystemVersion(),
    TotalDiskCapacity: await DeviceInfo.getTotalDiskCapacity(),
    TotalMemory: await DeviceInfo.getTotalMemory(),
github suijunqiang / rnset / src / components / user / loginAndRegister / LoginView_Register.js View on Github external
constructor (props) {
        console.log("LoginView");
        super (props);
        this.state = {
            userName:null,
            passwd:null,
            uuid:DeviceInfo.getDeviceId(),
        }
    }
github react-native-community / react-native-device-info / example / App.js View on Github external
getConstantDeviceInfo() {
    let deviceJSON = {};

    deviceJSON.uniqueId = DeviceInfo.getUniqueId();
    deviceJSON.deviceId = DeviceInfo.getDeviceId();
    deviceJSON.bundleId = DeviceInfo.getBundleId();
    deviceJSON.systemName = DeviceInfo.getSystemName();
    deviceJSON.systemVersion = DeviceInfo.getSystemVersion();
    deviceJSON.version = DeviceInfo.getVersion();
    deviceJSON.readableVersion = DeviceInfo.getReadableVersion();
    deviceJSON.buildNumber = DeviceInfo.getBuildNumber();
    deviceJSON.isTablet = DeviceInfo.isTablet();
    deviceJSON.appName = DeviceInfo.getApplicationName();
    deviceJSON.brand = DeviceInfo.getBrand();
    deviceJSON.model = DeviceInfo.getModel();
    deviceJSON.deviceType = DeviceInfo.getDeviceType();

    return deviceJSON;
  }
github infinitered / ignite / packages / ignite-dev-screens / templates / DeviceInfoScreen.js View on Github external
const HARDWARE_DATA = [
  {title: 'Device Manufacturer', info: DeviceInfo.getManufacturer()},
  {title: 'Device Name', info: DeviceInfo.getDeviceName()},
  {title: 'Device Model', info: DeviceInfo.getModel()},
  {title: 'Device Unique ID', info: DeviceInfo.getUniqueID()},
  {title: 'Device Locale', info: DeviceInfo.getDeviceLocale()},
  {title: 'Device Country', info: DeviceInfo.getDeviceCountry()},
  {title: 'User Agent', info: DeviceInfo.getUserAgent()},
  {title: 'Screen Width', info: Metrics.screenWidth},
  {title: 'Screen Height', info: Metrics.screenHeight}
]

const OS_DATA = [
  {title: 'Device System Name', info: DeviceInfo.getSystemName()},
  {title: 'Device ID', info: DeviceInfo.getDeviceId()},
  {title: 'Device Version', info: DeviceInfo.getSystemVersion()}
]

const APP_DATA = [
  {title: 'Bundle Id', info: DeviceInfo.getBundleId()},
  {title: 'Build Number', info: DeviceInfo.getBuildNumber()},
  {title: 'App Version', info: DeviceInfo.getVersion()},
  {title: 'App Version (Readable)', info: DeviceInfo.getReadableVersion()}
]

export default class DeviceInfoScreen extends React.Component {
  constructor (props) {
    super(props)

    this.state = {
      isConnected: false,
github bailabs / tailpos / src / store / PosStore / ReceiptStore.js View on Github external
"cancelled",
      ]),
      "draft",
    ),
    reason: types.optional(types.string, ""),
    customer: types.string,
    lines: types.optional(types.array(ReceiptLine), []),
    discountName: types.optional(types.string, ""),
    discount: types.optional(types.string, ""),
    discountValue: types.optional(types.number, 0),
    receiptNumber: types.optional(types.number, 0),
    discountType: types.optional(types.string, "percentage"),
    taxesValue: types.optional(types.string, ""),
    taxesAmount: types.optional(types.number, 0),
    shift: types.optional(types.string, ""),
    deviceId: types.optional(types.string, DeviceInfo.getDeviceId()),
    dateUpdated: types.optional(types.Date, Date.now),
    syncStatus: types.optional(types.boolean, false),
    attendant: types.optional(types.string, ""),
    orderType: types.optional(
      types.enumeration("OrderType", [
        "Dine-in",
        "Takeaway",
        "Delivery",
        "Online",
        "Family",
        "None",
      ]),
      "None",
    ),
  })
  .preProcessSnapshot(snapshot => assignUUID(snapshot, "Receipt"))
github newsuk / times-components / packages / ad / src / dom-context.android.js View on Github external
componentDidMount() {
    this.deviceInfo = {
      applicationName: DeviceInfo.getApplicationName(),
      buildNumber: DeviceInfo.getBuildNumber(),
      bundleId: DeviceInfo.getBundleId(),
      deviceId: DeviceInfo.getDeviceId(),
      readableVersion: DeviceInfo.getReadableVersion(),
      version: DeviceInfo.getVersion()
    };
  }
github guardian / editions / projects / Mallard / src / helpers / diagnostics.ts View on Github external
] = await Promise.all([
        NetInfo.fetch(),
        getGDPREntries(),
        getCASCode(),
        userDataCache.get(),
        iapReceiptCache.get(),
    ])
    const folderStat = await RNFetchBlob.fs.stat(FSPaths.issuesDir)
    const size = parseInt(folderStat.size)
    const bytes = size
    const kilobytes = bytes / 1000
    const megabytes = kilobytes / 1000
    const gigabytes = megabytes / 1000
    const buildNumber = DeviceInfo.getBuildNumber()
    const version = DeviceInfo.getVersion()
    const deviceId = DeviceInfo.getDeviceId()

    const [
        firstInstallTime,
        lastUpdateTime,
        totalDiskCapacity,
        freeDiskStorage,
        pushTracking,
        fileList,
    ] = await Promise.all([
        DeviceInfo.getFirstInstallTime(),
        DeviceInfo.getLastUpdateTime(),
        DeviceInfo.getTotalDiskCapacity(),
        DeviceInfo.getFreeDiskStorage(),
        getPushTracking(),
        getFileList(),
    ])
github textileio / photos / ignite / DevScreens / DeviceInfoScreen.js View on Github external
const HARDWARE_DATA = [
  {title: 'Device Manufacturer', info: DeviceInfo.getManufacturer()},
  {title: 'Device Name', info: DeviceInfo.getDeviceName()},
  {title: 'Device Model', info: DeviceInfo.getModel()},
  {title: 'Device Unique ID', info: DeviceInfo.getUniqueID()},
  {title: 'Device Locale', info: DeviceInfo.getDeviceLocale()},
  {title: 'Device Country', info: DeviceInfo.getDeviceCountry()},
  {title: 'User Agent', info: DeviceInfo.getUserAgent()},
  {title: 'Screen Width', info: Metrics.screenWidth},
  {title: 'Screen Height', info: Metrics.screenHeight}
]

const OS_DATA = [
  {title: 'Device System Name', info: DeviceInfo.getSystemName()},
  {title: 'Device ID', info: DeviceInfo.getDeviceId()},
  {title: 'Device Version', info: DeviceInfo.getSystemVersion()}
]

const APP_DATA = [
  {title: 'Bundle Id', info: DeviceInfo.getBundleId()},
  {title: 'Build Number', info: DeviceInfo.getBuildNumber()},
  {title: 'App Version', info: DeviceInfo.getVersion()},
  {title: 'App Version (Readable)', info: DeviceInfo.getReadableVersion()}
]

export default class DeviceInfoScreen extends React.Component {
  constructor (props) {
    super(props)

    this.state = {
      isConnected: false,