How to use the react-native-device-info.getApplicationName 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
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(),
github MetaMask / metamask-mobile / app / components / Views / Settings / AppInformation / index.js View on Github external
getAppInfo = () => {
		const appName = getApplicationName();
		const appVersion = getVersion();
		const buildNumber = getBuildNumber();

		return `${appName} v${appVersion} (${buildNumber})`;
	};
github newsuk / times-components / packages / ad / src / dom-context.js View on Github external
componentDidMount() {
    this.deviceInfo = {
      applicationName: DeviceInfo.getApplicationName(),
      buildNumber: DeviceInfo.getBuildNumber(),
      bundleId: DeviceInfo.getBundleId(),
      deviceId: DeviceInfo.getDeviceId(),
      readableVersion: DeviceInfo.getReadableVersion(),
      version: DeviceInfo.getVersion()
    };
  }
github brandingbrand / flagship / packages / pirateship / src / lib / analytics.ts View on Github external
} from '@brandingbrand/fsengage';

import { env as projectEnv } from '@brandingbrand/fsapp';

import { CommerceTypes } from '@brandingbrand/fscommerce';

import { Platform } from 'react-native';

import DeviceInfo from 'react-native-device-info';
const { version } = projectEnv;

const commonConfiguration = {
  userAgent: DeviceInfo.getUserAgent(),
  osType: Platform.OS,
  osVersion: (Platform.Version && Platform.Version.toString()) || '',
  appName: DeviceInfo.getApplicationName(),
  appId: DeviceInfo.getBundleId(),
  appVersion: version
};

const googleAnalyticsConfiguration = {
  trackerId: projectEnv.googleAnalytics[Platform.OS],
  clientId: DeviceInfo.getUniqueID()
};

const providers = [
  new GoogleAnalyticsProvider(
    commonConfiguration,
    googleAnalyticsConfiguration
  )
];
github improvein / personal-cryptofolio / src / screens / Settings.js View on Github external
style={styles.optionButton}
              value={this.state.pinProtection}
              onValueChange={this.onPinProtectionSwitch}
            />
          
          
            
          
          
            
          
          
            
          
          
        
      
    );
  }
}
github mattermost / mattermost-mobile / app / screens / image_preview / image_preview.js View on Github external
permissionRequest = await Permissions.request('photo');
            if (permissionRequest !== PermissionTypes.AUTHORIZED) {
                return;
            }
            break;
        case PermissionTypes.DENIED: {
            const canOpenSettings = await Permissions.canOpenSettings();
            let grantOption = null;
            if (canOpenSettings) {
                grantOption = {
                    text: formatMessage({id: 'mobile.permission_denied_retry', defaultMessage: 'Settings'}),
                    onPress: () => Permissions.openSettings(),
                };
            }

            const applicationName = DeviceInfo.getApplicationName();
            Alert.alert(
                formatMessage({
                    id: 'mobile.photo_library_permission_denied_title',
                    defaultMessage: '{applicationName} would like to access your photo library',
                }, {applicationName}),
                formatMessage({
                    id: 'mobile.photo_library_permission_denied_description',
                    defaultMessage: 'To save images and videos to your library, please change your permission settings.',
                }),
                [
                    grantOption,
                    {text: formatMessage({id: 'mobile.permission_denied_dismiss', defaultMessage: 'Don\'t Allow'})},
                ]
            );
            return;
        }
github mattermost / mattermost-mobile / app / components / post_textbox / components / cameraButton.js View on Github external
getPermissionDeniedMessage = (mediaType = '') => {
        const {formatMessage} = this.context.intl;
        const applicationName = DeviceInfo.getApplicationName();
        if (mediaType === 'video') {
            return {
                title: formatMessage({
                    id: 'mobile.camera_video_permission_denied_title',
                    defaultMessage: '{applicationName} would like to access your camera',
                }, {applicationName}),
                text: formatMessage({
                    id: 'mobile.camera_video_permission_denied_description',
                    defaultMessage: 'Take videos and upload them to your Mattermost instance or save them to your device. Open Settings to grant Mattermost Read and Write access to your camera.',
                }),
            };
        }

        return {
            title: formatMessage({
                id: 'mobile.camera_photo_permission_denied_title',
github newsuk / times-components / packages / ad / src / dom-context.android.js View on Github external
componentDidMount() {
    this.deviceInfo = {
      applicationName: DeviceInfo.getApplicationName(),
      buildNumber: DeviceInfo.getBuildNumber(),
      bundleId: DeviceInfo.getBundleId(),
      deviceId: DeviceInfo.getDeviceId(),
      readableVersion: DeviceInfo.getReadableVersion(),
      version: DeviceInfo.getVersion()
    };
  }
github mattermost / mattermost-mobile / app / components / attachment_button / index.js View on Github external
getPermissionDeniedMessage = (source, mediaType = '') => {
        const {formatMessage} = this.context.intl;
        const applicationName = DeviceInfo.getApplicationName();
        switch (source) {
        case 'camera': {
            if (mediaType === 'video') {
                return {
                    title: formatMessage({
                        id: 'mobile.camera_video_permission_denied_title',
                        defaultMessage: '{applicationName} would like to access your camera',
                    }, {applicationName}),
                    text: formatMessage({
                        id: 'mobile.camera_video_permission_denied_description',
                        defaultMessage: 'Take videos and upload them to your Mattermost instance or save them to your device. Open Settings to grant Mattermost Read and Write access to your camera.',
                    }),
                };
            }

            return {