feed_dghwgp

Update 1/2015: Salesforce has released official support for URL schemes in the Salesforce1 mobile app.

Update: Per Salesforce Support's comment below, this is not an officially supported technique. In other words, this deep link may break in the future. I think it's still a valuable tool while we wait for official support.

On your mobile device, when you click a twitter, or Facebook, or Instagram link in your mobile browser, the OS is often smart enough to launch the appropriate mobile app, instead of navigating to the mobile web version of the page. This provides for a more seamless and enjoyable user experience.

This is accomplished through URL schemes, where applications register reserved “keywords” with the OS, saying basically, “I'll handle anything with this URL”. For example, for twitter, anything with the url scheme “twitter://xxxx” will launch the twitter app, and navigate automatically to the page specified by “xxxx”.

It turns out the the Salesforce1 app has a limited url scheme handling capability as well. Navigating to this URL:

com.salesforce.salesforce1://entity/view?entityId={ObjectId}

will launch the SF1 mobile app, and navigate automatically to the detail page for the SObject record specified by “ObjectId”.

I found this technique last week in the Success Community in a post by Eanna Connane, but I wanted to surface it here to highlight it more, as I think it's a really useful technique.

I'm trying to figure out a good way to send emails that can sense (using media queries) whether the user is on a mobile client, and if so, provide deep links using the above scheme, and if not, use the traditional “http://na1.salesforce.con/ObjectId” method. There doesn't seem to be a good way to distinguish tablet (particularly in landscape orientation) from a narrow desktop browser window. I'd love to hear if anyone has any good techniques though.

I could also see this being useful for some home-built push notifications using a service like push.co while we wait for official push-to-SF1 support in Apex. It would be a great user experience to receive a push, open it, and be directed right to a record in SF1.