I want to display the Android Version in my app (like 8.0, 9.0...). For now I am using: Platform.Version
But this returns the API version (24, 25...).
I would like an option that's more elegant than just creating a mapping, and that does not require republishing every time there is a new android release. Is there a way to do that without an external library?
you can :
import { Platform } from 'react-native';
const OsVer = Platform.constants['Release'];
You can use this library,
react-native-device-info
import DeviceInfo from "react-native-device-info";
DeviceInfo.getSystemVersion()
apart from version, it has lots of methods which are much handy for getting device specific information.
EDIT: It is getSystemVersion()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With