You need to sign in to do that
Don't have an account?
Fakeha Quazi
Not able to subscribe to Platform events using cometD in visualforce or force.com site
I am trying to subscribe to a Platform event in force.com site page in visualforce page. I am using cometD to subscribe.Using below code. It works internally in org. But when using the page on site page session id is null, so, it is not working. Is there any way to subscribe to platform event and access it on site page?
cometd.websocketEnabled = false; var auth = 'OAuth ' + '{!$Api.Session_ID}'; var cometdURL = window.location.protocol+'//'+window.location.hostname+ (null != window.location.port ? (':'+window.location.port) : '') +'/cometd/48.0/'; cometd.configure({ url: cometdURL, requestHeaders: { Authorization: auth} });
Are you viewing the site as a guest user? If so, you need to have full platform license for it.
See https://salesforce.stackexchange.com/questions/219946/platform-event-for-guest-community-user
If this information helps, please mark the answer as best. Thank you