javascriptreactjsreact-nativenative

How to get Android Version number in React-Native? (not API level number)


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?


Solution

  • you can :

    import { Platform } from 'react-native';
    
    const OsVer = Platform.constants['Release'];