Skip to content

Commit

Permalink
Merge pull request #59 from stdavis/newer-country-api
Browse files Browse the repository at this point in the history
use newer country api on expo sdk 31+
  • Loading branch information
tschoffelen authored Apr 2, 2019
2 parents 85759f4 + 63a57b1 commit 02f7828
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/react-native-version-check-expo/src/ExpoVersionInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ if (process.env.RNVC_ENV === 'test') {
android: { versionCode = null, package: androidPackageName = null } = {},
ios: { bundleIdentifier = null, buildNumber = null } = {},
} = manifest;
let country;
if (Constants.expoVersion < 26) {
country = Util.getCurrentDeviceCountryAsync();
} else if (Constants.expoVersion < 31) {
country = Localization.getCurrentDeviceCountryAsync();
} else {
country = Localization.country;
}

RNVersionCheck = {
currentVersion: version,
country: `${
Constants.expoVersion < 26
? Util.getCurrentDeviceCountryAsync()
: Localization.getCurrentDeviceCountryAsync()
}`,
country,
currentBuildNumber: Platform.select({
android: versionCode,
ios: buildNumber,
Expand Down

0 comments on commit 02f7828

Please sign in to comment.