You need to sign in to do that
Don't have an account?
gbu.varun
Streaming API not running
Hi,
I have developed a VF for Streaming API which is working fine in developer edition. When I am running same code in another developer edition it is not running. I think there is some setting missing. Please help me.
<apex:page > <apex:includeScript value="{!$Resource.cometd}"/> <apex:includeScript value="{!$Resource.jquery1}"/> <apex:includeScript value="{!$Resource.json2}"/> <apex:includeScript value="{!$Resource.jquery_cometd}"/> <script type="text/javascript"> (function($){ $(document).ready(function() { // Connect to the CometD endpoint $.cometd.init({ url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/', requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'} }); // Subscribe to a topic. JSON-encoded update will be returned // in the callback $.cometd.subscribe('/topic/Push', function(message) { $('#content').append('<p>Notification: ' + 'Channel: ' + JSON.stringify(message.channel) + '<br>' + 'Record name: ' + JSON.stringify(message.data.sobject.Name) + '<br>' + 'ID: ' + JSON.stringify(message.data.sobject.Id) + '<br>' + 'Event type: ' + JSON.stringify(message.data.event.type)+ '<br>' + 'Created: ' + JSON.stringify(message.data.event.createdDate) + '</p>'); }); }); })(jQuery) </script> <body> <div id="content"> <h1>Streaming API Test Page</h1> <p>This is a demonstration page for Streaming API. Notifications from the InvoiceStatementUpdates channel will appear here...</p> </div> </body> </apex:page>
Did you create hte PushTopics in the second org too?
Yes I created.
Here is my code to create push topic.
executing?
Hi Boman,
I am able to see notification in workbench but not in Salesforce. I am not able to run following command
I think I am hitting any ouath or api limitation.