The Environment API allows you to check which platform your app is currently running on.
You need to add a reference to
"FuseJS" in your project file to use this feature.
You can check which platform your app is running on using the following boolean properties:
var Environment = require('FuseJS/Environment'); if(Environment.ios) console.log("Running on iOS"); if(Environment.android) console.log("Running on Android"); if(Environment.preview) console.log("Running in preview mode"); if(Environment.mobile) console.log("Running on iOS or Android"); if(Environment.desktop) console.log("Running on desktop");
You can also get the version of the current mobile OS as a
human-readable string using the
mobileOSVersionreturns Build.VERSION.RELEASE (e.g.
3.4b5). On iOS, it returns a string in the format of
9.2.1). Returns an empty string on all other platforms.
- FuseJS 1.9.0
Interface of Environment
Inherited from NativeModule
Inherited from Module
GetFile : FileSource uno
Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.