How to use the react-native-device-info.getDeviceCountry 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 EdgeApp / edge-react-gui / src / components / modals / CountrySelectionModal.js View on Github external
constructor (props: CountrySelectionModalProps) {
    super(props)
    const deviceCountry = DeviceInfo.getDeviceCountry() // "US"
    this.state = {
      input: '',
      countryCode: props.countryCode || deviceCountry || 'US'
    }
  }
github infinitered / ignite / ignite-base / App / Containers / DeviceInfoScreen.js View on Github external
// @flow

// An All Components Screen is a great way to dev and quick-test components
import React from 'react'
import { View, ScrollView, Text, Image, NetInfo } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import { Metrics, Images } from '../Themes'
import styles from './Styles/DeviceInfoScreenStyles'

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()}
github textileio / photos / ignite / DevScreens / DeviceInfoScreen.js View on Github external
// An All Components Screen is a great way to dev and quick-test components
import React from 'react'
import { View, ScrollView, Text, Image, NetInfo, TouchableOpacity } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import Reactotron from 'reactotron-react-native'
import { Metrics, Images } from './DevTheme'
import styles from './Styles/DeviceInfoScreenStyles'

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()}
github easemob / webim-react-native / App / Containers / DeviceInfoScreen.js View on Github external
// @flow

// An All Components Screen is a great way to dev and quick-test components
import React from 'react'
import { View, ScrollView, Text, Image, NetInfo } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import { Metrics, Images } from '../Themes'
import styles from './Styles/DeviceInfoScreenStyle'

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()}
github infinitered / ignite / packages / ignite-dev-screens / templates / DeviceInfoScreen.js View on Github external
// An All Components Screen is a great way to dev and quick-test components
import React from 'react'
import { View, ScrollView, Text, Image, NetInfo, TouchableOpacity } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import { Metrics, Images } from './DevTheme'
import styles from './Styles/DeviceInfoScreenStyles'

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()}
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(),
  systemName: DeviceInfo.getSystemName(),
  systemVersion: DeviceInfo.getSystemVersion(),
github mattermost / mattermost-mobile / app / telemetry / telemetry_utils.js View on Github external
export function getDeviceInfo() {
    const {height, width} = Dimensions.get('window');

    return {
        api_level: DeviceInfo.getAPILevel(),
        build_number: DeviceInfo.getBuildNumber(),
        bundle_id: DeviceInfo.getBundleId(),
        brand: DeviceInfo.getBrand(),
        country: DeviceInfo.getDeviceCountry(),
        device_id: DeviceInfo.getDeviceId(),
        device_locale: DeviceInfo.getDeviceLocale().split('-')[0],
        device_type: DeviceInfo.getDeviceType(),
        device_unique_id: DeviceInfo.getUniqueID(),
        height: height ? Math.floor(height) : 0,
        is_emulator: DeviceInfo.isEmulator(),
        is_tablet: DeviceInfo.isTablet(),
        manufacturer: DeviceInfo.getManufacturer(),
        max_memory: DeviceInfo.getMaxMemory(),
        model: DeviceInfo.getModel(),
        system_name: DeviceInfo.getSystemName(),
        system_version: DeviceInfo.getSystemVersion(),
        timezone: DeviceInfo.getTimezone(),
        app_version: DeviceInfo.getVersion(),
        width: width ? Math.floor(width) : 0,
    };
github UCSD / campus-mobile / app / services / feedbackService.js View on Github external
formData.append('element_3', feedback.email)
		formData.append(
			'element_4',
			'Device Manufacturer: ' + Device.getManufacturer() + '\n' +
			'Device Brand: ' + Device.getBrand() + '\n' +
			'Device Model: ' + Device.getModel() + '\n' +
			'Device ID: ' + Device.getDeviceId() + '\n' +
			'System Name: ' + Device.getSystemName() + '\n' +
			'System Version: ' + Device.getSystemVersion() + '\n' +
			'Bundle ID: ' + Device.getBundleId() + '\n' +
			'App Version: ' + Device.getVersion() + '\n' +
			'Build Number: ' + Device.getBuildNumber() + '\n' +
			'Device Name: ' + Device.getDeviceName() + '\n' +
			'User Agent: ' + Device.getUserAgent() + '\n' +
			'Device Locale: ' + Device.getDeviceLocale() + '\n' +
			'Device Country: ' + Device.getDeviceCountry() + '\n' +
			'Timezone: ' + Device.getTimezone()
		)
		formData.append('form_id','175631')
		formData.append('submit_form','1')
		formData.append('page_number','1')
		formData.append('submit_form','Submit')

		return fetch(FEEDBACK_URL, {
			method: 'POST',
			body: formData
		})
			.then(response => (response))
			.catch(error => (error))
	}
}
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 Skjutsgruppen / skjutsgruppen-reactnative / app / helpers / device.js View on Github external
export const getCountry = () => DeviceInfo.getDeviceCountry();
export const getTimezone = () => DeviceInfo.getTimezone();