I have the following code:
import { put } from "redux-saga/effects"
import { actions, AppStrings } from "common"
const DeviceInfo = require("react-native-device-info")
interface CheckIosVersionAction {
readonly type: "CHECK_IOS_VERSION"
readonly buildNumber: number
readonly systemName: string
}
export function* checkIosVersion(action: CheckIosVersionAction): {} {
if (DeviceInfo.getSystemName() !== "iOS") {
return
}
const deviceBuildNumber = parseInt(DeviceInfo.getBuildNumber(), 10)
if (action.buildNumber > deviceBuildNumber) {
yield put(
actions.receiveError(AppStrings.AppStrings.landing.invalidVersion),
)
}
}
I'm trying to add device version to the information payload. I have the app version passing as it should but I can't get the device version to work as it should.I thought of adding DeviceInfo.getVersion() at the end but that doesn't seem to work very well either.