Flamingo.Device.getPlatform()

The getPlatform() method returns string value android if the current device is detected as an Android device, ios if the current device is detected as an iOS device, firefoxos for FirefoxOS devices, windowsmobile for Windows Mobile devices, and windows, macos, or linux for desktops depending on the OS they are running on.

Syntax

Flamingo.Device.getPlatform()

Parameters

None.

Return Value

Type Description
String ’android’, ‘ios’, ‘firefoxos’, ‘windowsmobile’, ‘windows’, ‘macos’, ‘linux’ depending on the OS user’s device is running on.

Example

You can use the following code in template to show which platform the user’s device is running on:

<!--{= Flamingo.Device.getPlatform() }-->

If user opens a page, for example, on iPad, the result will be:

ios

See also