function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JfostJfost 

Community VisualForce Page Erroring in Mobile

I am getting this error page when viewing the VF page on a mobile device (both IOS and Android) after successfully logging into the Community. It's not a FLS Permission Issue because the page works flawlessly on Desktop following the exact same steps.. The Community User Profile also has access to the VF Page and all other dependencies..

vf page mobile error

URL Description: https://base_url.csxx.force.com/community_name/s/page_name?param=record_id

Any ideas on why this is happening or how to resolve for mobile?

Much appreciated!
Best Answer chosen by Jfost
JfostJfost
So I figured this out for anyone reading... I am trying to pull a URL parameter from the Community URL... but it seems mobile does not like ApexPages.currentPage().getHeaders().get('referer').substringAfter('?param=')... opening a new question to figure out how to get URL parameters into Visualforce Pages on the mobile device. How do you know it's mobile? Use this in your Visualforce Page Controller: Boolean isMobile = UserInfo.getUiTheme() == 'Theme4t';

All Answers

VinayVinay (Salesforce Developers) 
Check vf page has access to community user profile along with Available for Lightning Experience, Experience Builder sites, and the mobile app checkbox.

https://salesforceoke.blogspot.com/2018/02/salesforce-community-error-page.html

Thanks,
JfostJfost
Thanks @Vinay. I have validated both of those. Setup > Visualforce Pages > navigated to the page in question > Security > validated both Community Profile & Community User Profile ar enabled. I also validated the page has the checkbox for 'Available for Lightning Experience, Experience Builder sites, and the mobile app'.
JfostJfost
So I figured this out for anyone reading... I am trying to pull a URL parameter from the Community URL... but it seems mobile does not like ApexPages.currentPage().getHeaders().get('referer').substringAfter('?param=')... opening a new question to figure out how to get URL parameters into Visualforce Pages on the mobile device. How do you know it's mobile? Use this in your Visualforce Page Controller: Boolean isMobile = UserInfo.getUiTheme() == 'Theme4t';
This was selected as the best answer
JfostJfost
Thank you - https://salesforce.stackexchange.com/questions/140233/useragent-check-to-see-mobile-or-web
Thank you - https://releasenotes.docs.salesforce.com/en-us/spring16/release-notes/rn_vf_uitheme.htm
Thank you - https://salesforce.stackexchange.com/questions/203914/see-full-vf-page-exception-vf-apex-exception
VinayVinay (Salesforce Developers) 
Good to know you figured it out... Cheers!!
JfostJfost
@Vinay maybe you could answer my secondary question: https://salesforce.stackexchange.com/questions/336756/how-to-get-url-into-controller-on-mobile