Using the Streaming API Event
The Canvas SDK contains an event called sfdc.streamingapi that lets you define an event in your canvas app and associate that event with a Streaming API channel. You then use the subscribe method to subscribe to the event and receive Streaming API notifications.
For example, in Salesforce, you can create a Streaming API channel that receives notifications when an InvoiceStatement is updated and the Status changes to Closed. In your canvas app, you can then create an event associated with that channel and subscribe to it. In Salesforce, whenever an invoice statement is closed, the activated canvas app receives the notification and can perform an action such as displaying a message to the user.
- The event takes a single parameter that contains the PushTopic name.
- The PushTopic name must be prefaced by “/topic/.”
{name:"sfdc.streamingapi", params:{topic:"/topic/myPushTopicName"}}