diff --git a/ts/utils/__tests__/appVersion.test.ts b/ts/utils/__tests__/appVersion.test.ts index ab3ade5135a..b144b0d8309 100644 --- a/ts/utils/__tests__/appVersion.test.ts +++ b/ts/utils/__tests__/appVersion.test.ts @@ -7,6 +7,11 @@ jest.mock("react-native-device-info", () => { .mockReturnValueOnce("1.1.3") .mockReturnValueOnce("1.1.9") .mockReturnValueOnce("1.2.3.4"), + getVersion: jest + .fn() + .mockReturnValueOnce("1.1.3") + .mockReturnValueOnce("1.1.9") + .mockReturnValueOnce("1.2.3.4"), getBuildNumber: () => 3 }; }); diff --git a/ts/utils/appVersion.ts b/ts/utils/appVersion.ts index 4c4907cfcce..bfe37594e14 100644 --- a/ts/utils/appVersion.ts +++ b/ts/utils/appVersion.ts @@ -48,7 +48,11 @@ export const isVersionAppSupported = ( return semSatisfies; }; -export const getAppVersion = () => DeviceInfo.getReadableVersion(); +export const getAppVersion = () => + Platform.select({ + ios: DeviceInfo.getReadableVersion(), + default: DeviceInfo.getVersion() + }); /** * return true if the app must be updated