Implementing Canvas App Events
Events provide a JavaScript-based way to send and receive events between canvas apps. Use events to enable communication between multiple canvas apps on a single page.
One scenario might be a page on which you expose two custom apps as canvas apps: a travel and expense app, and an approvals app. You can create an event so that when the status of an expense report changes, that event gets raised and contains data (in JSON format) about that expense report. The approvals canvas app subscribes to that event and specifies a function that’s called when the event is raised. When the status is changed, the approvals app receives the event and the specified function runs.
- publish—Creates a custom event to which other canvas apps or Visualforce pages can subscribe. See Creating a Canvas App Event.
- subscribe—Subscribes to a parent event or custom event. This method can be used to subscribe to multiple events. See Subscribing to a Canvas App Event.
- unsubscribe—Unsubscribe from a parent event or custom event. This method can be used to unsubscribe from multiple events. See Unsubscribing from a Canvas App Event.