Has anyone figured out a way to differentiate between Lightning Desktop and Salesforce1?
I know officially (same link – see ‘Limitations of Detecting sforce.one’) there is no supported mechanism yet. I’ve also read about the Visualforce workaround that is out at the moment.
I want to know specifically a front end way to tell the two interfaces apart.
With Spring 16 release, we are getting new values added to the existing
$User.UITheme Global variable and to the
UserInfo.getUiTheme() method which will help us to identify the current user’s UI mode.
here’s the list of possible values
- Theme1 — Obsolete Salesforce theme
- Theme2 — Salesforce Classic 2005 user interface theme
- Theme3 — Salesforce Classic 2010 user interface theme
- Theme4d — Modern “Lightning Experience” Salesforce theme
- Theme4t — Salesforce1 mobile Salesforce theme
- PortalDefault — Salesforce Customer Portal theme
- Webstore — Salesforce AppExchange theme
hopefully we can use this in Workflows, Validations, Formulas, Apex & Visualforce..