Demo code to show the use of the Streaming API through Visualforce.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Push Notifications Demo for Salesforce

You will also need a Push Topic some like this:

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'AllAccounts';
pushTopic.Query = 'SELECT id, name FROM Account';
pushTopic.ApiVersion = 26.0;
pushTopic.NotifyForOperations = 'All';
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;