Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9
// * note this is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled
console.log("Device Manufacturer", DeviceInfo.getManufacturer()); // e.g. Apple
console.log("Device Model", DeviceInfo.getModel()); // e.g. iPhone 6
console.log("Device ID", DeviceInfo.getDeviceId()); // e.g. iPhone7,2 / or the board on Android e.g. goldfish
console.log("Device Name", DeviceInfo.getSystemName()); // e.g. iPhone OS
console.log("Device Version", DeviceInfo.getSystemVersion()); // e.g. 9.0
console.log("Bundle Id", DeviceInfo.getBundleId()); // e.g. com.learnium.mobile
console.log("Build Number", DeviceInfo.getBuildNumber()); // e.g. 89
console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0
console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89
console.log("Device Name", DeviceInfo.getDeviceName()); // e.g. Becca's iPhone 6
console.log("User Agent", DeviceInfo.getUserAgent()); // e.g. Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D)
ModuleConfig.brand = 'mongrov.com';
ModuleConfig.bootstrapUrl = 'roverz.mongrov.com';
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);
},
var SettingsService = (function() {
var STORAGE_KEY = "@TSLocationManager:settings";
// react-native-device-info
var deviceInfo = {
uuid: DeviceInfo.getUniqueID(),
model: DeviceInfo.getModel(),
platform: DeviceInfo.getSystemName(),
manufacturer: DeviceInfo.getManufacturer(),
version: DeviceInfo.getSystemVersion()
};
var _settings = {
common: [
{name: 'url', group: 'http', inputType: 'text', dataType: 'string', defaultValue: 'http://posttestserver.com/post.php?dir=ionic-cordova-background-geolocation'},
{name: 'autoSync', group: 'http', dataType: 'boolean', inputType: 'select', values: [true, false], defaultValue: true},
{name: 'batchSync', group: 'http', dataType: 'boolean', inputType: 'select', values: [true, false], defaultValue: false},
{name: 'maxBatchSize', group: 'http', dataType: 'integer', inputType: 'select', values: [50, 100, 250, 500], defaultValue: 250},
{name: 'stopOnTerminate', group: 'application', dataType: 'boolean', inputType: 'select', values: [true, false], defaultValue: true},
{name: 'debug', group: 'application', dataType: 'boolean', inputType: 'select', values: [true, false], defaultValue: true},
{name: 'stopAfterElapsedMinutes', group: 'geolocation', dataType: 'number', inputType: 'select', values: [0, 1, 2, 5, 10, 15], defaultValue: 0},
{name: 'activityRecognitionInterval', group: 'activity recognition', dataType: 'integer', inputType: 'select', values: [0, 1000, 10000, 30000, 60000], defaultValue: 10000},
{name: 'stopTimeout', group: 'activity recognition', dataType: 'integer', inputType: 'select', values: [0, 1, 5, 10, 15], defaultValue: 1},
{name: 'disableElasticity', group: 'geolocation', dataType: 'boolean', inputType: 'select', values: [true, false], defaultValue: false},
if (savedProfileId && typeof savedProfileId === 'string' && !forceProfileSync) {
this.profileId = savedProfileId;
return Promise.resolve(savedProfileId);
}
return this.networkClient.post(`/App/${this.appId}/getProfile`, {
locale: DeviceInfo.getDeviceLocale(),
country: DeviceInfo.getDeviceCountry(),
timezone: DeviceInfo.getTimezone(),
deviceIdentifier: DeviceInfo.getUniqueID(),
accountId,
deviceInfo: JSON.stringify({
model: DeviceInfo.getModel(),
appName: DeviceInfo.getBundleId(),
appVersion: DeviceInfo.getReadableVersion(),
osName: DeviceInfo.getSystemName(),
osVersion: DeviceInfo.getSystemVersion()
})
})
.then((r: any) => r.data)
.then((data: any) => {
this.profileId = data.id;
this.profileData = data;
AsyncStorage.setItem('ENGAGEMENT_PROFILE_ID', data.id).catch();
return data.id;
})
.catch((e: any) => {
console.log(e.response);
console.error(e);
});
handleOnSubmitFeedback = () => {
const {
i18n,
addError,
navigation: { goBack },
} = this.props;
const { feedback, email } = this.state;
Keyboard.dismiss();
this.setState({ loading: true });
this.ref
.push()
.set({
platform: DeviceInfo.getSystemName(),
manufacturer: DeviceInfo.getManufacturer(),
brand: DeviceInfo.getBrand(),
model: DeviceInfo.getModel(),
systemVersion: DeviceInfo.getSystemVersion(),
appVersion: DeviceInfo.getVersion(),
appBuildNumber: DeviceInfo.getBuildNumber(),
locale: DeviceInfo.getDeviceLocale(),
createdAt: firebase.database.ServerValue.TIMESTAMP,
feedback,
email,
})
.then(() => {
this.setState({ loading: false });
goBack();
InteractionManager.runAfterInteractions(() => {
DeviceEventEmitter.emit('showToast', i18n.feedbackSuccess);
export const collectData = async () => ({
id: deviceInfo.getUniqueID(),
brand: deviceInfo.getBrand(),
model: deviceInfo.getModel(),
deviceKind: deviceInfo.getDeviceId(),
os: deviceInfo.getSystemName(),
osVersion: deviceInfo.getSystemVersion(),
appVersion: deviceInfo.getReadableVersion(),
jsVersion: pkg.version,
ua: deviceInfo.getUserAgent(),
ip: await getIpAddress(),
dateRecorded: new Date().toJSON(),
})
onActionSelected = () => {
if (feedbackText === undefined || feedbackText.replace(/\s+/g, '') === '') {
ToastUtil.showShort('请填写建议内容哦~');
} else {
const feedback = AV.Object.new('Feedback');
feedback.set('manufacturer', DeviceInfo.getManufacturer());
feedback.set('system', DeviceInfo.getSystemName());
feedback.set('deviceVersion', DeviceInfo.getSystemVersion());
feedback.set('deviceModel', DeviceInfo.getModel());
feedback.set('appVersion', DeviceInfo.getVersion());
feedback.set('feedback', feedbackText);
feedback.save();
ToastUtil.showShort('您的问题已反馈,我们会及时跟进处理');
this.textInput.clear();
Keyboard.dismiss();
}
};
const getDeviceInfo = () => `
----- Please do not edit below here -----
${DeviceInfo.getBrand()} ${DeviceInfo.getModel()}
${DeviceInfo.getDeviceId()}
${DeviceInfo.getSystemName()} ${version}
${DeviceInfo.getReadableVersion()}
`
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()}
]
export default class DeviceInfoScreen extends React.Component {
state: {
isConnected: boolean,
connectionInfo: Object | null,
connectionInfoHistory: Array
getDeviceInfo = () => `
----- Please do not edit below here -----
${DeviceInfo.getBrand()} ${DeviceInfo.getModel()}
${DeviceInfo.getDeviceId()}
${DeviceInfo.getSystemName()} ${DeviceInfo.getSystemVersion()}
${DeviceInfo.getReadableVersion()}
Codepush: ${version}
`