Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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(),
UniqueID: DeviceInfo.getUniqueId(),
UserAgent: await DeviceInfo.getUserAgent(),
Version: DeviceInfo.getVersion(),
isEmulator: await DeviceInfo.isEmulator(),
isTablet: DeviceInfo.isTablet(),
}
}
const AWS = require('aws-sdk/dist/aws-sdk-react-native')
const AMA = require('react-native-aws-mobile-analytics')
const DeviceInfo = require('react-native-device-info')
import settings from '../config/settings'
AWS.config.region = settings.awsRegion
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
region: settings.awsRegion,
IdentityPoolId: settings.awsIdentityPoolId
})
const mobileAnalyticsClient = new AMA.default.Manager({
appId: settings.awsAppId,
appTitle: settings.awsTitle,
appVersionName: DeviceInfo.getReadableVersion(),
make: DeviceInfo.getManufacturer(),
model: DeviceInfo.getModel(),
platform: convertPlatformName(DeviceInfo.getSystemName()),
platformVersion: DeviceInfo.getSystemVersion()
})
function initAwsMobileAnalytics () {
mobileAnalyticsClient.initialize(() => {
console.log('Cognito Identity ID: ' + AWS.config.credentials.params.IdentityPoolId)
recordDynamicCustomEvent('APP_STARTED')
})
}
function recordDynamicCustomEvent (type) {
mobileAnalyticsClient.recordEvent(type)
}
render() {
const version = `Version: ${DeviceInfo.getReadableVersion()
.split('.')
.slice(0, 3)
.join('.')} (${DeviceInfo.getBuildNumber()})`;
return (
getLatestAvailableBootloader: function (background = true) {
let appVersionArray = DeviceInfo.getReadableVersion().split(".");
if (Array.isArray(appVersionArray) && appVersionArray.length >= 3) {
let appVersion = appVersionArray[0] + '.' + appVersionArray[1] + '.' + appVersionArray[2];
return cloudApiBase._setupRequest('GET', '/Bootloaders/latest?appVersion=' + appVersion, {background: background});
}
else {
return new Promise((resolve, reject) => { reject("Can't get app version correctly."); })
}
},
};
render() {
const version = `Version: ${DeviceInfo.getReadableVersion()
.split('.')
.slice(0, 3)
.join('.')} (${DeviceInfo.getBuildNumber()})`;
const linking = url => () => {
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url).catch(() => null);
} else {
Alert.alert(
'Nicht unterstützt',
'Diese Operation wird auf Deinem Gerät zurzeit nicht unterstützt!',
[{ text: 'OK' }],
{ cancelable: false },
);
}
});
render() {
let factor = 0.25;
return (
)
}
}
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;
}
width: 0.5*screenWidth,
height:30,
alignItems:'flex-start',
justifyContent:'flex-end'
}}
onPress={() => { Linking.openURL('https://shop.crownstone.rocks/?launch=en&ref=http://crownstone.rocks/en/').catch(err => {}) }}>
)
}
}
const getDeviceInfo = () => `
----- Please do not edit below here -----
${DeviceInfo.getBrand()} ${DeviceInfo.getModel()}
${DeviceInfo.getDeviceId()}
${DeviceInfo.getSystemName()} ${version}
${DeviceInfo.getReadableVersion()}
`
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(),
})