我有以下代码:
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),
)
}
}
我正在尝试将设备版本添加到信息有效负载中。我已经通过了应有的应用程序版本,但是我无法获得应有的设备版本。我想到了最后添加DeviceInfo.getVersion(),但这似乎也不起作用。>