Device Detection With Devicedetect.js In Salesforce

Device Detection With Devicedetect.js In Salesforce

A good responsive design in UI can render behaviour across different screen sizes. Though there are few edge cases in Salesforce development, especially where you want to redirect traffic to a mobile-specific page, detect the device and even detect Salesforce1 Application itself.

You can probably do this with the help of a library known as DeviceDetect.js Inspired by isMobile.js. Upload it as a static Resource and then refer it in your Visualforce Page.<apex:includeScript value=”{!URLFOR($Resource.DeviceDetect, ‘/js/deviceDetect.min.js’)}” />

1.)  Opened in Phone Check:


2.) Opened in Tablet Check:


3.) Opened in Desktop Device Check:


4.) Opened in Salesforce1 Check:


Call the methods as shown below to detect devices and context:

Screenshot from 2018-01-30 18:41:14

“What are your super powers again? – I can Detect Devices” 31163A0400000578-3442108-image-a-27_1455189872679


Leave a Reply


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?