How to use the expo-localization.country function in expo-localization

To help you get started, we’ve selected a few expo-localization 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 kimxogus / react-native-version-check / packages / react-native-version-check-expo / src / ExpoVersionInfo.js View on Github external
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,
    }),
  };
}