Using Events between a Visualforce Page and a Canvas App

Canvas provides methods that you can use to publish and subscribe to events between your canvas app and the parent Visualforce page. This process includes publishing events from your Visualforce page, listening for events on your Visualforce page, unsubscribing from events on your Visualforce page, and resizing the Visualforce page that contains the canvas app. This process for resizing a canvas app differs from the process where the canvas app resizes itself, which is described in Resizing a Canvas App. Full reference documentation for these methods can be found in the SDK and here. The Controller.js object is needed for the Visualforce page to use these methods. Your script in the Visualforce page might look something like this:
<script type="text/javascript"src="https://yourDomain.my.salesforce.com/canvas/sdk/js/30.0/controller.js">

You can use Lightning Platform methods to smoothly integrate navigation between a canvas app and the Salesforce mobile app, without using Visualforce. The methods are events that reside in the JavaScript library within the Canvas framework. When you call one of the navigation methods from your canvas code, you send an event into Salesforce that reads the payload and directs the user to the specified destination. For more information, see Salesforce Mobile App Navigation Methods for Use with Canvas Apps.

Note