UITheme.getUITheme() does not work as expected in mobile
Last updated 2019-08-10 ·Reference W-6172683 ·Reported By 0 users
UITheme.getUITheme() does not work as expected in mobile.
In Classic/Lightning, function returns expected string value.
However, only in mobile, it returns blank string.
1. create the following Visualforce page
Name : mytestvf
document.getElementById('UI').innerText = UITheme.getUITheme();
* enable "Available for Lightning Experience, Lightning Communities, and the mobile app" option
2. Create a Visualforce tab with the above Visualforce page
3. Add the above Visualforce tab to Mobile Navigation
4. Access to the org by mobile browser.
Or you can use mobile device simulator of Chrome Dev Tools.
5. Go to the Visualforce tab which was added in Step 3
You would see Visualforce apge is shown but it is blank. This is unexpected.
When accessing the same VF page in Classic UI, you will see "Theme3" in the VF page.
And, when accessing the same VF page in LEX, you will see "Theme4d" in the VF page.
Please consider to use$User.UIThemeDisplayed global variable instead of UITheme.getUITheme(), or add showHeader="true" expressly to the affected Visualforce page.
Or, set the API version of the affected Visualforce page to 32.0 or more prior.
Reported By (0)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.