Salesforce Mobile App Context Considerations
Keep these considerations in mind when you display a canvas app inside of the Salesforce mobile app.
When you display a canvas app inside of the feed or publisher, the canvas context you receive (either from the Signed Request or from the getContext call) contains information specific to the Salesforce mobile app publisher.
-
You can verify you’re on either the feed or publisher by looking at the
displayLocationvalue in the environment section. For publisher,displayLocationis set toPublisher. For the feed,displayLocationis set toChatterFeed. -
When creating a Canvas feed item, you can specify a
JSONstring as the parameter’s value. When the context is sent, any value in the parameter’s field on the feed item is sent in the parameters of the environment section of the context. -
As with any canvas app, the context contains information about the app’s dimensions. Since Salesforce is designed for mobile, the sizes we provide for it are different than the ones we provide for the full Salesforce sites.
-
To create a single-finger touch scrolling experience:
-
Ensure that the outermost
divelements contain the following properties.- min-height: 250px;
- overflow: scroll;
- width: 100%;
- -webkit-overflow-scrolling: touch;
- -webkit-transform: translated(0%,0px,0px);
-
Set the
heightattribute to theclientHeightvalue delivered in the signed request. For example: -
The
clientHeightvalue can be very small, particularly in a phone’s landscape mode, and users might not be able to see any content. Usemin-heightset to the desired height in pixels to ensure a good user experience. -
In the navigation menu, the default puzzle icon size is 60 pixels by 60 pixels.
-
See Also