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.displayLocationfield contains the valuePublisher. -
Size—The
Environment.Dimensionsobject 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 Automaticallywhen 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 themaxHeightandmaxWidth.
-
See Also