Unsubscribing from a Streaming API Event
This code example shows how to call the unsubscribe method so that a canvas app can unsubscribe from a Streaming API event.
//Unsubscribe from Streaming API events.
//The PushTopic to unsubscribe from must be passed in.
Sfdc.canvas(function() {
sr = JSON.parse('<%=signedRequestJson%>');
Sfdc.canvas.client.unsubscribe(sr.client, {name : 'sfdc.streamingapi',
params:{topic:"/topic/InvoiceStatements"}});
});