Get Device Type (Android or iOS)
Question

Hi!

We've created an app that we want some features to be exclusive to each device type (Android or iOS). How can we do that? I've tried GetDeviceType from MobilePatterns, however, it only shows if the device is a phone or a tablet. 

Thank you, Paulo! I've tried your solution, but the plugin you've suggested is not stabe in my environment. 


I've found a different solution: in the Common Plugin there's a "GetPlatform" action which informs if the device is "android" or "ios". I used it with an if statement to only show some features if the device is a determined platform.

Hi Rafaela,

You can use this plugin of the forge: https://www.outsystems.com/forge/component-overview/1646/device-information or https://www.outsystems.com/forge/component-overview/5389/get-device-information

Other option, you can create a client action, and get the info with javascript, like this:

$parameters.IsAvailable = device.available;
$parameters.CordovaVersion = device.cordova;
$parameters.IsVirtual = device.isVirtual;
$parameters.Manufacturer = device.manufacturer;
$parameters.Model = device.model;
$parameters.Platform = device.platform;
$parameters.Serial = device.serial;
$parameters.Uuid = device.uuid;
$parameters.Version = device.version;


Regards,

Paulo

Thank you, Paulo! I've tried your solution, but the plugin you've suggested is not stabe in my environment. 


I've found a different solution: in the Common Plugin there's a "GetPlatform" action which informs if the device is "android" or "ios". I used it with an if statement to only show some features if the device is a determined platform.

mvp_badge
MVP

@Rafaela

You can also use OutSystems' own JavaScript API to obtain that information.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/JavaScript_API/Device


Can't add 'GetDeviceModel' element as a Dependency because 'GetDeviceInformation' Module has broken Dependencies. Open 'GetDeviceInformation' Module, then open Manage Dependencies and fix the issue.


I've got a misquote here

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.