Fuse Community

Foreign Code - OS version check

Hey guys,

Do we have like a central “utils class” whereby we can check the OS version?

In Uno, Objective-C and Java?

For example with Uno:

if (iOSVersionEqualTo(13)) {
    //uno code
}

if (iOSVersionGreaterThan(13)) {
    //uno code
}

if (AndroidVersionLessThan(8)) {
    //uno code
}

The closest thing currently is probably the FuseJS/Environment module.

https://fuseopen.com/docs/fusejs/environment.html

The mobileOSVersion, android and ios fields should provide the information you need to implement the utility functions in your example.

Shweet man :+1:, I ended up using this from the Environment module for an Uno iOS version check:

Fuse.iOSDevice.OperatingSystemVersion.Major

If my .uno file is outside of fuselibs in a separate project, it doesn’t have access to Fuse.iOSDevice: Fuse does not contain type or namespace 'iOSDevice'. Could you be missing a package reference? How can I explicitly add it to the project?