How to use the expo-constants.expoVersion 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 / build / environment / validate.fx.js View on Github external
import { 
// React Native's internal InitializeCore module sets up `window` but runs only when its React
// renderer is loaded. We can cause this by loading one of its dependents.
findNodeHandle, } from 'react-native';
import Constants from 'expo-constants'; // eslint-disable-line no-unused-expressions
import { shouldThrowAnErrorOutsideOfExpo } from './validatorState';
findNodeHandle; // eslint-disable-line no-unused-expressions
if (shouldThrowAnErrorOutsideOfExpo() && (!Constants || !Constants.expoVersion)) {
    throw new Error(`The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.`);
}
//# sourceMappingURL=validate.fx.js.map
github expo / expo / packages / expo / src / environment / validate.fx.ts View on Github external
import {
  // React Native's internal InitializeCore module sets up `window` but runs only when its React
  // renderer is loaded. We can cause this by loading one of its dependents.
  findNodeHandle,
} from 'react-native';
import Constants from 'expo-constants'; // eslint-disable-line no-unused-expressions

import { shouldThrowAnErrorOutsideOfExpo } from './validatorState';

findNodeHandle; // eslint-disable-line no-unused-expressions

if (shouldThrowAnErrorOutsideOfExpo() && (!Constants || !Constants.expoVersion)) {
  throw new Error(
    `The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.`
  );
}
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 kimxogus / react-native-version-check / packages / react-native-version-check-expo / src / ExpoVersionInfo.js View on Github external
if (process.env.RNVC_ENV === 'test') {
  RNVersionCheck = {
    country: 'ko',
    packageName: 'com.reactnative.versioncheck',
    currentBuildNumber: 1,
    currentVersion: '0.0.1',
  };
} else {
  const { manifest = {} } = Constants;
  const {
    version = null,
    android: { versionCode = null, package: androidPackageName = null } = {},
    ios: { bundleIdentifier = null, buildNumber = null } = {},
  } = manifest;
  let country;
  if (Constants.expoVersion < 31) {
    country = Localization.getCurrentDeviceCountryAsync();
  } else {
    country = Localization.country;
  }

  RNVersionCheck = {
    currentVersion: version,
    country,
    currentBuildNumber: Platform.select({
      android: versionCode,
      ios: buildNumber,
    }),
    packageName: Platform.select({
      android: androidPackageName,
      ios: bundleIdentifier,
    }),
github expo / expo / home / screens / ProjectsScreen.js View on Github external
_renderConstants = () => {
    return (
      
    );
  };
github janaagaard75 / expo-and-typescript / src / constants / ConstantsScreen.tsx View on Github external
public render() {
    const navigate = this.props.navigation.navigate;

    return (
      
    );
github expo / expo / home / screens / ProjectsScreen.js View on Github external
_copyClientVersionToClipboard = () => {
    Clipboard.setString(Constants.expoVersion);
    alert('The client version has been copied to your clipboard');
  };
github expo / expo / home / screens / ProjectsScreen.js View on Github external
_renderConstants = () => {
    return (
      
    );
  };
github FaridSafi / react-native-gifted-chat / example-expo / NavBar.js View on Github external
export default function NavBarCustom() {
  if (Platform.OS === 'web') {
    return null
  }
  return (
    
      
        
        
          💬 Gifted Chat{'\n'}
          
        
        
      
    
  )
}
github expo / expo / home / screens / ProjectsScreen.js View on Github external
_copyClientVersionToClipboard = () => {
    Clipboard.setString(Constants.expoVersion);
    alert('The client version has been copied to your clipboard');
  };