How to use the expo-constants.deviceYearClass function in expo-constants

To help you get started, we’ve selected a few expo-constants 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 expo / expo / packages / expo / src / AR.ts View on Github external
export function isAvailable(): boolean {
  // Device has A9 chip
  const hasA9Chip = Constants.deviceYearClass && Constants.deviceYearClass > 2014;

  if (
    !Constants.isDevice || // Prevent Simulators
    // @ts-ignore
    Platform.isTVOS ||
    Platform.OS !== 'ios' || // Device is iOS
    !hasA9Chip ||
    !ExponentAR.isSupported || // ARKit is included in the build
    !ExponentAR.startAsync // Older SDK versions (27 and lower) that are fully compatible
  ) {
    return false;
  }

  return true;
}
github Marwan01 / food-converter / node_modules / expo / build / AR.js View on Github external
export function isAvailable() {
    // Device has A9 chip
    const hasA9Chip = Constants.deviceYearClass && Constants.deviceYearClass > 2014;
    if (!Constants.isDevice || // Prevent Simulators
        // @ts-ignore
        Platform.isTVOS ||
        Platform.OS !== 'ios' || // Device is iOS
        !hasA9Chip ||
        !ExponentAR.isSupported || // ARKit is included in the build
        !ExponentAR.startAsync // Older SDK versions (27 and lower) that are fully compatible
    ) {
        return false;
    }
    return true;
}
export function getUnavailabilityReason() {
github flow-typed / flow-typed / definitions / npm / expo-constants_v4.x.x / flow_v0.69.0-v0.103.x / test_expo-constants.js View on Github external
it('should passes when used properly', () => {
      (Constants.debugMode: boolean);
      (Constants.deviceName: ?string);
      (Constants.deviceYearClass: number | null);
      (Constants.experienceUrl: string);
      (Constants.expoRuntimeVersion: string);
      (Constants.expoVersion: string);
      (Constants.isDetached: ?boolean);
      (Constants.intentUri: ?string);
      (Constants.installationId: string);
      (Constants.isDevice: boolean);
      (Constants.isHeadless: boolean);
      (Constants.linkingUri: string);
      (Constants.sessionId: string);
      (Constants.statusBarHeight: number);
      (Constants.systemVersion: ?number);
      (Constants.systemFonts: Array);
    });
github Marwan01 / food-converter / node_modules / expo / build / AR.js View on Github external
export function getUnavailabilityReason() {
    if (!Constants.isDevice) {
        return AvailabilityErrorMessages.Simulator;
    }
    else if (Platform.OS !== 'ios') {
        return `${AvailabilityErrorMessages.ARKitOnlyOnIOS} ${Platform.OS} device`;
    }
    else if (Constants.deviceYearClass == null || Constants.deviceYearClass < 2015) {
        return `${AvailabilityErrorMessages.ANineChip} ${Constants.deviceYearClass} device`;
    }
    return 'Unknown Reason';
}
export function onFrameDidUpdate(listener) {
github expo / expo / packages / expo / src / AR.ts View on Github external
export function getUnavailabilityReason(): string {
  if (!Constants.isDevice) {
    return AvailabilityErrorMessages.Simulator;
  } else if (Platform.OS !== 'ios') {
    return `${AvailabilityErrorMessages.ARKitOnlyOnIOS} ${Platform.OS} device`;
  } else if (Constants.deviceYearClass == null || Constants.deviceYearClass < 2015) {
    return `${AvailabilityErrorMessages.ANineChip} ${Constants.deviceYearClass} device`;
  }
  return 'Unknown Reason';
}
github janaagaard75 / expo-and-typescript / src / constants / ConstantsScreen.tsx View on Github external
public render() {
    const navigate = this.props.navigation.navigate;

    return (