function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Artie BArtie B 

References to URLs returned by Apex ConnectApi in Salesforce1 mobile

I have a VF page that I am using as an inline page on the Opportunity detail page layout. It retrieves and displays files (FeedItems with ConnectApi.ContentCapability) from Chatter feeds on records related to the Opportunity. After making the page available for mobile, it will display within the Salesforce1 mobile app. However, there are two URLs returned with the ContentCapability class that wraps the Chatter File, downloadUrl and renditionUrl, that apparently don't work within the mobile container. The following VF, where file is a reference to an instance of ConnectApi.ContentCapability renders fine on the desktop (and in /one/one.app, incidentally), but the image does not display in the mobile app, nor does the the download link work. The title attribute works just fine.
 
<div class="col-xs-6 col-sm-3 col-md-2">
    <a href="{!file.downloadUrl}" class="thumbnail">
        <img src="{!file.renditionUrl}" />
    </a>
    <div class="captionContainer">
        <h6>{!file.title}</h6>
    </div>
</div>

Is there a way to "convert" these URLs to something that SF1 would understand...or do I need to use the Chatter REST API or some other method to fetch these URLs when the page is running in the mobile context?

The downloadUrl looks like

https://c.na17.content.force.com/sfc/servlet.shepherd/version/download/068o0000000wrG3?asPdf=false&operationContext=CHATTER

and the renditionUrl looks like

https://c.na17.content.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=068o0000000wrj0&operationContext=CHATTER&contentId=05To00000009kkc

Thanks,

Artie
Gaurav KheterpalGaurav Kheterpal
If I understand this correctly, you are trying to deep link this with Salesforce1?

If so, please take a look at this document which describes the various custom URL linking schemes that Salesforce1 can successfullly interpret - http://bit.ly/s1deeplinking

I hope this helps.
Artie BArtie B
Thanks Guarav, but no.  I'm trying to render a Chatter file in a VF page within the SF1 mobile framework.  And the URLs returned by the Connect API (Chatter) don't seem to work within the SF1 mobile container.