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.
Chatter Feed Context Considerations
When you display a canvas app inside of a feed item, the
context information you receive from the signed request or from a getContext() call contains information
specific to the feed:
- Location—If the canvas app is in the feed, then the Environment.displayLocation field contains the value ChatterFeed.
- Parameters—When you create a feed item that contains a canvas app, you can specify a JSON string as the parameters value. When the canvas app receives the context, the parameters in the feed item will be contained in the Environment.Parameters object.
- Size—The Environment.Dimensions object contains information about the size of the canvas app.
- The canvas app height defaults to 100 pixels.
- The canvas app width defaults to 420 pixels, which is the same as the maximum width of a canvas app in the feed.
- The maximum height of a canvas app in the feed is 400 pixels.
- The maximum width of a canvas app in the feed is 420 pixels.
- This code snippet shows the default size values of a canvas app
in the feed:
1"dimensions": 2{ 3 "width": "420px", 4 "height": "100px", 5 "maxHeight": "400px", 6 "maxWidth": "420px" 7} - The feed is a fixed width of 420 pixels. For example, if you resize your canvas app to be 200 pixels, the feed width remains 420 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.