Skip to content

Commit 63a57b1

Browse files
committed
use newer country api on expo sdk 31+
1 parent 85759f4 commit 63a57b1

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

packages/react-native-version-check-expo/src/ExpoVersionInfo.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ if (process.env.RNVC_ENV === 'test') {
2020
android: { versionCode = null, package: androidPackageName = null } = {},
2121
ios: { bundleIdentifier = null, buildNumber = null } = {},
2222
} = manifest;
23+
let country;
24+
if (Constants.expoVersion < 26) {
25+
country = Util.getCurrentDeviceCountryAsync();
26+
} else if (Constants.expoVersion < 31) {
27+
country = Localization.getCurrentDeviceCountryAsync();
28+
} else {
29+
country = Localization.country;
30+
}
2331

2432
RNVersionCheck = {
2533
currentVersion: version,
26-
country: `${
27-
Constants.expoVersion < 26
28-
? Util.getCurrentDeviceCountryAsync()
29-
: Localization.getCurrentDeviceCountryAsync()
30-
}`,
34+
country,
3135
currentBuildNumber: Platform.select({
3236
android: versionCode,
3337
ios: buildNumber,

0 commit comments

Comments
 (0)