Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Publisher Context Considerations
When you display a canvas app inside the publisher, the
context information you receive from the signed request or from a getContext() call contains information
specific to the publisher:
- Location—If the canvas app is in the publisher, then the Environment.displayLocation field contains the value Publisher.
- Size—The Environment.Dimensions object contains information about the size of the canvas app.
- The canvas app height will be the height you specify in the quick action that you created.
- If you selected Create Actions Automatically when you created the canvas app, the canvas app height defaults to 200 pixels.
- The canvas app width defaults to 521 pixels, which is the same as the maximum width of a canvas app in the publisher.
- The maximum height of a canvas app in the publisher is 500 pixels.
- The maximum width of a canvas app in the publisher is 521 pixels.
- This code snippet shows the default size values of a canvas app
in the publisher:
- The publisher is a fixed width of 521 pixels. For example, if you resize your canvas app to be 400 pixels, the publisher width remains 521 pixels.
- You can use the resize() method in the Canvas SDK to change the values of your canvas app up to the maxHeight and maxWidth.