How to use the react-native-device-info.isEmulator 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
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(),
  timezone: DeviceInfo.getTimezone(),
  storageSize: DeviceInfo.getTotalDiskCapacity(),
  totalMemory: DeviceInfo.getTotalMemory(),
  uniqueId: DeviceInfo.getUniqueID(),
  userAgent: DeviceInfo.getUserAgent(),
  version: DeviceInfo.getVersion(),
  is24Hour: DeviceInfo.is24Hour(),
  isEmulator: DeviceInfo.isEmulator(),
  isTablet: DeviceInfo.isTablet(),
})
github crownstone / CrownstoneApp / js / ExternalConfig.ts View on Github external
*  The local file is ignored if RELEASE_MODE is set to true.
 */


/******************** APP ********************/

  /**
   * enabling Debug behaviour throughout the app.
   */
  export let DEBUG = false;

  /**
   * Disable Native will automatically mock all BLE commands so the app can run in the simulator.
   * Silence cloud will silently reject all cloud calls.
   */
  export let DISABLE_NATIVE = DeviceInfo.isEmulator();
  export let SILENCE_CLOUD  = false;

  /**
   * IMPORTANT: ENCRYPTION_ENABLED determines how the app communicates with the crownstone
   * IMPORTANT: AMOUNT_OF_CROWNSTONES_FOR_INDOOR_LOCALIZATION sets the limit before indoor localization is allowed.
   */
  export let ENCRYPTION_ENABLED = true;   // Enable encryption for the app and the libs
  export const AMOUNT_OF_CROWNSTONES_FOR_INDOOR_LOCALIZATION = 4;


  /**
   * Point to the production cloud.
   */
  export let CLOUD_ADDRESS = 'https://cloud.crownstone.rocks/api/';
github NSWSESMembers / availability-poc / client / src / push / apns.js View on Github external
const init = (pushManager) => {
  // APNS doesn't work in the simulator
  const isSimulator = DeviceInfo.isEmulator();

  // if this native module is missing then the shell build is missing push notifications
  const hasNativeModule = typeof NativeModules.PushNotificationManager !== 'undefined';
  if (hasNativeModule && !isSimulator) {
    return new APNSClient(pushManager);
  }
  return null;
};
github crownstone / CrownstoneApp / js / LocalConfig.template.ts View on Github external
*  The local file is ignored if RELEASE_MODE is set to true.
 */


/******************** APP ********************/

  /**
   * enabling Debug behaviour throughout the app.
   */
  export let DEBUG = false;

  /**
   * Disable Native will automatically mock all BLE commands so the app can run in the simulator.
   * Silence cloud will silently reject all cloud calls.
   */
  export let DISABLE_NATIVE = DeviceInfo.isEmulator();
  export let SILENCE_CLOUD  = false;

  /**
   * IMPORTANT: ENCRYPTION_ENABLED determines how the app communicates with the crownstone
   * IMPORTANT: AMOUNT_OF_CROWNSTONES_FOR_INDOOR_LOCALIZATION sets the limit before indoor localization is allowed.
   */
  export let ENCRYPTION_ENABLED = true;   // Enable encryption for the app and the libs
  export const AMOUNT_OF_CROWNSTONES_FOR_INDOOR_LOCALIZATION = 4;


  /**
   * Point to the production cloud.
   */
  export let CLOUD_ADDRESS = 'https://cloud.crownstone.rocks/api/';
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 rainbow-me / rainbow / src / screens / QRScannerScreen.js View on Github external
top: Header.height,
      }}
      enableCamera={isFocused}
      enableScanning={enableScanning}
      isCameraAuthorized={isCameraAuthorized}
      onSuccess={onScanSuccess}
      showCrosshairText={!!walletConnectorsCount}
    />
    
      
      {DeviceInfo.isEmulator() && (
        <button type="pill" style="{{" size="small" color="{colors.sendScreen.brightBlue}">
          Paste session URI
        </button>
      )}
    
github rainbow-me / rainbow / src / components / qrcode-scanner / QRCodeScanner.js View on Github external
const showCrosshair = !error &amp;&amp; !showErrorMessage;

    return (
      
        {this.renderCamera()}
        {isCameraAuthorized &amp;&amp; (
          
            {showErrorMessage &amp;&amp; (
              
            )}
            {showCrosshair &amp;&amp; (
              
            )}
          
        )}
      
    );
  }
}
github rainbow-me / rainbow / src / components / settings-menu / SettingsSection.js View on Github external
onPressReview: ({ onCloseModal }) => async () => {
      const maxRequestCount = 2;
      const count = await getAppStoreReviewCount();
      const shouldDeeplinkToAppStore =
        count >= maxRequestCount || !StoreReview.isAvailable;

      if (shouldDeeplinkToAppStore && !DeviceInfo.isEmulator()) {
        Linking.openURL(SettingsExternalURLs.review);
      } else {
        onCloseModal();
        InteractionManager.runAfterInteractions(StoreReview.requestReview);
      }

      return saveAppStoreReviewCount(count + 1);
    },
    onPressTwitter: () => async () => {
github rainbow-me / rainbow / src / components / qrcode-scanner / QRCodeScanner.js View on Github external
return (
      
        {this.renderCamera()}
        {isCameraAuthorized &amp;&amp; (
          
            {showErrorMessage &amp;&amp; (
              
            )}
            {showCrosshair &amp;&amp; (
              
            )}
          
        )}
      
    );
  }
}
github demokratie-live / democracy-client / src / hocs / PushNotifications.js View on Github external
constructor(props) {
      super(props);
      switch (Platform.OS) {
        case 'ios':
          NotificationsIOS.addEventListener('remoteNotificationsRegistered', this.onPushRegistered);
          NotificationsIOS.addEventListener(
            'remoteNotificationsRegistrationFailed',
            this.onPushRegistrationFailed,
          );
          if (!DeviceInfo.isEmulator()) {
            NotificationsIOS.requestPermissions();
          }

          NotificationsIOS.addEventListener('notificationReceivedForeground', notification => {
            this.onNotificationReceivedForeground(notification.getData());
          });
          NotificationsIOS.addEventListener('notificationReceivedBackground', notification => {
            this.onNotificationReceivedBackground(notification.getData());
          });
          NotificationsIOS.addEventListener('notificationOpened', notification => {
            this.onNotificationOpened(notification.getData());
          });
          break;
        case 'android':
          if (!LISTENERS_ADDED) {
            LISTENERS_ADDED = true;