You need to sign in to do that
Don't have an account?
Andrew Kulik
Geolocation has been disabled in this document by feature policy
We have an Angular app inside a VisualForce page and are trying to use "navigator.geolocation.getCurrentPosition". This is working ok in a scratch org but when I push the changes to a sandbox I get the error "Geolocation has been disabled in this document by feature policy".
I have a found the same question here https://salesforce.stackexchange.com/questions/207245/salesforce1-stopped-supporting-geolocation but there isn't an answer.
I have a found the same question here https://salesforce.stackexchange.com/questions/207245/salesforce1-stopped-supporting-geolocation but there isn't an answer.
Try below snippet.
<iframe id="ap3-iframe" src="https://example.com/your-geo-page/?appp=3" allow="geolocation"></iframe>
Review below link for more information.
https://docs.apppresser.com/article/418-iframe-geolocation-feature-policy
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
Thanks for the answer. I have had a look but I can't see that we are using an iframe anywhere or should I add an iframe to our visualforce page and put the API url as the src?
Try to include iframe in VF page also check if Clickjack protection was enabled for visualforce page.
In Setup ---> Session Settings ---> Clickjack Protection
Uncheck - Enable clickjack protection for customer Visualforce pages with headers disabled .
Review below links which can give you more information.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_iframe.htm
https://help.salesforce.com/articleView?id=000322792&type=1&mode=1
https://stackoverflow.com/questions/51717856/geolocation-has-been-disabled-in-this-document-by-feature-policy
Thanks,
Vinay Kumar