Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (props: CountrySelectionModalProps) {
super(props)
const deviceCountry = DeviceInfo.getDeviceCountry() // "US"
this.state = {
input: '',
countryCode: props.countryCode || deviceCountry || 'US'
}
}
// @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()}
// 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()}
// @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()}
// 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()}
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(),
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,
};
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))
}
}
_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);
}
export const getCountry = () => DeviceInfo.getDeviceCountry();
export const getTimezone = () => DeviceInfo.getTimezone();