How to use the react-native-device-info.getBuildNumber 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 sishuguojixuefu / react-native-template-sishu-0.59 / app / utils / getDeviceInfo.ts View on Github external
const getDeviceInfo = () => ({
  apiLevel: Platform.OS === 'ios' ? '' : DeviceInfo.getAPILevel(),
  appName: DeviceInfo.getApplicationName(),
  brand: DeviceInfo.getBrand(),
  buildNumber: DeviceInfo.getBuildNumber(),
  bundleId: DeviceInfo.getBundleId(),
  deviceCountry: DeviceInfo.getDeviceCountry(),
  deviceId: DeviceInfo.getDeviceId(),
  deviceLocale: DeviceInfo.getDeviceLocale(),
  deviceName: DeviceInfo.getDeviceName(),
  firstInstallTime: Platform.OS === 'ios' ? '' : DeviceInfo.getFirstInstallTime(),
  freeDiskStorage: DeviceInfo.getFreeDiskStorage(),
  referrer: Platform.OS === 'ios' ? '' : DeviceInfo.getInstallReferrer(),
  instanceId: Platform.OS === 'ios' ? '' : DeviceInfo.getInstanceID(),
  lastUpdateTime: Platform.OS === 'ios' ? '' : DeviceInfo.getLastUpdateTime(),
  manufacturer: DeviceInfo.getManufacturer(),
  maxMemory: DeviceInfo.getMaxMemory(),
  model: DeviceInfo.getModel(),
  phoneNumber: Platform.OS === 'ios' ? '' : DeviceInfo.getPhoneNumber(), // 权限http://t.cn/EP3kKhY
  readableVersion: DeviceInfo.getReadableVersion(),
  serialNumber: Platform.OS === 'ios' ? '' : DeviceInfo.getSerialNumber(),
github EdgeApp / edge-react-gui / src / modules / UI / components / HelpModal / HelpModal.ui.js View on Github external
// @flow

import React, { Component } from 'react'
import { Dimensions, Image, Linking, Platform, Text, View } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import { WebView } from 'react-native-webview'

import helpImage from '../../../../assets/images/modal/help.png'
import s from '../../../../locales/strings.js'
import THEME from '../../../../theme/variables/airbitz.js'
import { PLATFORM } from '../../../../theme/variables/platform.js'
import { isIphoneX } from '../../../../util/isIphoneX.js'
import StylizedModal from '../Modal/index.js'
import styles from './style.js'

const buildNumber = DeviceInfo.getBuildNumber()
const versionNumber = DeviceInfo.getVersion()
const CONTENT_URI = 'https://edgesecure.co/info.html'
const contentScaling = Platform.OS !== 'ios'

type Props = {
  modal: any,
  closeModal: () => void
}

export default class HelpModal extends Component {
  getRef = (ref: any) => {
    // $FlowFixMe
    this.webview = ref
  }

  render () {
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(),
github mattermost / mattermost-mobile / app / screens / settings / general / settings.js View on Github external
errorEmailBody = () => {
        const {config, currentUserId, currentTeamId, errors} = this.props;
        let contents = [
            'Please share a description of the problem:\n\n',
            `Current User Id: ${currentUserId}`,
            `Current Team Id: ${currentTeamId}`,
            `Server Version: ${config.Version} (Build ${config.BuildNumber})`,
            `App Version: ${DeviceInfo.getVersion()} (Build ${DeviceInfo.getBuildNumber()})`,
            `App Platform: ${Platform.OS}`,
        ];
        if (errors.length) {
            const errorArray = errors.map((e) => {
                const {error} = e;
                const stack = error.stack || '';
                return `Date: ${e.date}\nMessage: ${error.message}\nStack trace:\n${stack}\n\n`;
            }).join('');

            contents = contents.concat([
                '',
                'Errors:',
                errorArray,
            ]);
        }
        return contents.join('\n');
github guardian / editions / projects / Apps / editionsSrc / src / screens / settings / dev-zone.tsx View on Github external
const DevZone = withNavigation(({ navigation }: NavigationInjectedProps) => {
    const { attempt, signOutCAS } = useContext(AccessContext)
    const { showToast } = useToast()

    const [files, setFiles] = useState('fetching...')
    const [pushTrackingInfo, setPushTrackingInfo] = useState('fetching...')
    const buildNumber = DeviceInfo.getBuildNumber()

    useEffect(() => {
        getFileList().then(fileList => {
            setFiles(JSON.stringify(fileList, null, 2))
        })
    }, [])

    useEffect(() => {
        getPushTracking().then(pushTracking => {
            pushTracking && setPushTrackingInfo(pushTracking)
        })
    }, [])

    const query = useQuery<{ [key: string]: unknown }>(
        gql(`{ ${ALL_SETTINGS_FRAGMENT} }`),
    )
github celo-org / celo-monorepo / packages / mobile / src / app / Debug.tsx View on Github external
render() {
    const { reactNativeLogs, gethLogs, latestBlockNumber } = this.state
    const pincodeType = this.props.account.pincodeType
    const address = currentAccountSelector(this.props) || ''
    const phoneNumber = this.props.account.e164PhoneNumber
    const version = DeviceInfo.getVersion()
    const buildNumber = DeviceInfo.getBuildNumber()
    const apiLevel = DeviceInfo.getAPILevel()
    const deviceId = DeviceInfo.getDeviceId()
    return (
github mattermost / mattermost-mobile / app / store / middleware.js View on Github external
threadDrafts = payload.views.thread.drafts;
    }

    let selectServer = initialState.views.selectServer;
    if (payload.views.selectServer) {
        selectServer = payload.views.selectServer;
    }

    let recentEmojis = initialState.views.recentEmojis;
    if (payload.views.recentEmojis) {
        recentEmojis = payload.views.recentEmojis;
    }

    const nextState = {
        app: {
            build: DeviceInfo.getBuildNumber(),
            version: DeviceInfo.getVersion(),
        },
        entities: {
            channels,
            general,
            teams,
            users,
            preferences,
            search,
            roles,
        },
        views: {
            channel: {
                drafts: channelDrafts,
            },
            i18n,
github redbaron76 / MeteorNative / RNApp / app / scenes / List.js View on Github external
_getDeviceInfos() {
        const infos = [];
        infos.push({label:"Device Manufacturer", data: DeviceInfo.getManufacturer()});
        infos.push({label:"Device Brand", data: DeviceInfo.getBrand()});
        infos.push({label:"Device Model", data: DeviceInfo.getModel()});
        infos.push({label:"Device ID", data: DeviceInfo.getDeviceId()});
        infos.push({label:"System Name", data: DeviceInfo.getSystemName()});
        infos.push({label:"System Version", data: DeviceInfo.getSystemVersion()});
        infos.push({label:"Bundle ID", data: DeviceInfo.getBundleId()});
        infos.push({label:"Build Number", data: DeviceInfo.getBuildNumber()});
        infos.push({label:"App Version", data: DeviceInfo.getVersion()});
        infos.push({label:"App Version Readable", data: DeviceInfo.getReadableVersion()});
        infos.push({label:"Device name", data: DeviceInfo.getDeviceName()});
        infos.push({label:"User Agent", data: DeviceInfo.getUserAgent()});
        infos.push({label:"Device Locale", data: DeviceInfo.getDeviceLocale()});
        infos.push({label:"Device Country", data: DeviceInfo.getDeviceCountry()});
        infos.push({label:"Unique ID", data: DeviceInfo.getUniqueID()});
        infos.push({label:"App Instance ID", data: DeviceInfo.getInstanceID()});

        const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
        return ds.cloneWithRows(infos);
    }
github istvanmakary / react-native-debugger / src / debugger.js View on Github external
import { values, pick, omit } from 'lodash';
import { Platform } from 'react-native';
import deviceInfo from 'react-native-device-info';
import { initialize, batchDebugEvents } from './redux/module';

const device = {
  bundleId: deviceInfo.getBundleId(),
  name: deviceInfo.getDeviceName(),
  platform: Platform.OS,
  id: deviceInfo.getUniqueID(),
  buildNumber: deviceInfo.getBuildNumber(),
  country: deviceInfo.getDeviceCountry(),
};

const __config = {
  isVisible: false,
  logLevel: 'ALL',
  eventTypes: [
    {
      TYPE: 'NETWORK',
      CATEGORY_NAME: 'Network request logging',
      EVENT_NAME: 'Net. Request',
    }
  ],
};

const defaultConfig = {
github textileio / photos / ignite / DevScreens / DeviceInfoScreen.js View on Github external
{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,
      connectionInfo: null,
      connectionInfoHistory: []
    }
  }

  componentDidMount () {