I'd like to show a lightning component on a public Force.com Site. I've created a lightning app and put my component into the app. Then I added it into my Visualforce page.
Lightning App:
<aura:application description="PrivacyPageApp" access="GLOBAL" implements="ltng:allowGuestAccess" extends="ltng:outApp">
<aura:dependency resource="RGDPR:PrivacyPage" />
</aura:application>
Visualforce Page:
<apex:page standardStylesheets="false" showHeader="false" sideBar="false" cache="false">
<apex:includeLightning />
<div id="lightningComponent" />
<script>
$Lightning.use("RGDPR:PrivacyPageApp", function() {
$Lightning.createComponent(
"RGDPR:PrivacyPage",
{
leadContactId: '{!$CurrentPage.parameters.id}',
pageId: '{!$CurrentPage.parameters.pageId}'
},
"lightningComponent",
function(component) {
}
);
});
</script>
</apex:page>
I enabled Community. Must I create any community?
But when I go to my Visualforce page I get an error message in Chrome console:
How to make it work for Force.com sites?