Flamingo.Device.getType()¶
The getType() method returns string value phone if the current device is detected as smartphone, tablet if current device is detected as tablet, and desktop if current device is detected as desktop.
Syntax¶
Flamingo.Device.getType()
Parameters¶
None.
Return Value¶
Type | Description |
---|---|
String | ’phone’, ‘tablet’ or ‘desktop’ depending on the user’s device. |
Example: Display current device type¶
You can use the following code in template to show the type of the device that is being used at the moment:
<!--{= if Flamingo.Device.getType() }-->
If user opens page, for example, on iPad, the result will be:
tablet