runOnVersion

inline fun <T> runOnVersion(minVersion: Int? = null, maxVersion: Int? = null, platform: Application.ApplicationType? = null, action: () -> T?): T?

Executes action is the current platform version (such as Android API version or iOS major OS version) is equal to or higher than minVersion and equal to or lower than maxVersion. If a platform is given, the currentPlatform must also be the same in order to execute the action.

All parameters are optional; if a parameter is not given, the associated condition does not have to be met to execute action. For example, if minVersion is given, but maxVersion is not, the current application version has to be the same as or above minVersion, but there is no upper bound. Similarly, if a platform is not given, the action will be executed on any platform that meets the version criteria.

Returns action result if it was executed or null otherwise.

See also