developer guide: turn your force.com canvas app into a salesforce1 app

30
Surface Your Existing Force.com Canvas App in Salesforce1 Patricia Cifra Senior Software Eng. @pncifra Gordon Bockus Senior Software Eng. @gordonk66

Upload: spanning-cloud-apps

Post on 29-Jun-2015

293 views

Category:

Technology


2 download

DESCRIPTION

Using Spanning Backup for Salesforce as a real-world example, we'll walk you through the steps to translate your Canvas app into a mobile app that can be used on Salesforce1. We'll explain the steps necessary in Salesforce, the technologies and tools we used, the challenges we encountered and how we overcame them. This is a terrific resource for anyone looking to get started with Salesforce1. If you'd like to download the full developer guide, you can get it here: http://bit.ly/SF1devguide.

TRANSCRIPT

Page 1: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Surface Your Existing Force.com Canvas App in Salesforce1

Patricia CifraSenior Software Eng.@pncifra

Gordon BockusSenior Software Eng.@gordonk66

Page 2: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Overview

• What is a Canvas App?

• What is a Salesforce1 App?

• Configuration Changes

• Application Changes

• Tools

• Challenges

Page 3: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

What is a Canvas app?

• Web application embedded in the Salesforce platform via an iframe.• Has several advantages over a standalone third-party Salesforce offering • When launched, app is provided with signed request. This signed request gives the app the ability

to identify the user/organization that is accessing the it and an authentication token that can be

used to acquire Salesforce data via the Force.com rest API. • Also provides mechanisms for the application to resize its containing iframe to fit into the view

where it is embedded. • Can be inserted in various locations throughout the Salesforce CRM:

• Standalone page with its own tab • Embedded in any of the standard objects like Accounts, Leads, Contacts, etc.

• Can also be linked to a Chatter post • Allows you to have a single app that adapts to where it is being displayed

Page 4: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Webpage with Tab

Page 5: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Embedded in Chatter Post

Page 6: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

What is a Salesforce1 app?

Page 7: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

What is a Salesforce1 app?

• New Mobile platform for Salesforce• Built around Salesforce’s API feeds• Platform that is mobile-ready and more accessible to customers• Accessible via web/browser or native web• Mobile platform introduced at Dreamforce last year

Page 8: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Technology Stack

• AngularJS: Open-source web application framework maintained by google.

Used for building SPAs (Single page apps)

• Twitter Bootstrap 3: Front-end framework built by Twitter that provides grids,

components, javascript plugins, typography, form controls

• Sass: CSS preprocessor that provides tools to better organize and maintain

your CSS

• Node: Cross platform runtime environment for server-side and networking

applications. runs our server side application which is written in javascript

Page 9: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Tools and Frameworks for Mobile

• Twitter Bootstrap 3

• Multi-device support

• Mobile first and always responsive

• Preprocessors

• Cross browser

• Mobile detection in Angular

Page 10: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Configuration Changes

• Salesforce:

1. VisualForce Page

2. Canvas Application• Web Application:

3. CSS

4. JS

Page 11: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Add Visualforce Page to Mobile Navigation

Page 12: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Enable Visualforce Page for Mobile

Page 13: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Enable the SF1 Mobile Browser

Page 14: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Web Application Changes

• Detecting Mobile:• Width• http://detectmobilebrowsers.com

• After Mobile is Detected:• Add CSS class to main container• Direct application to load mobile view

Page 15: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Required JavaScript

Page 16: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Detect Mobile

Page 17: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Mobile-Enabled CSS

Page 18: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Scroll Vertically/Fill Horizontally

• min-height: 250px

• overflow: scroll;

• width: 100%;

• webkit-overflow-scrolling:touch;

• webkit-transform: translated(0%,0px,0px);

Page 19: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Navigation & Layout for Desktop Version

Page 20: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Navigation & Layout for Mobile Version

Page 21: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Reusable Components

• Controllers• Reused Controllers for:

• Batch Views• Details• Activities• Log histories

• Common Utilities•Http•Services•Filters•Constants

• Styles

Page 22: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Mobile Templates

Page 23: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Mobile Templates

Page 24: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Mobile Templates

Page 25: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Development - Chrome

Page 26: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Development - iOS

Page 27: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Development - Android

• Genymotion

• Hostname

• StaticIP

Page 28: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Development - Native

• Deploy to a public webserver • Install Canvas app in test domain• Test on devices• Test web version!

Page 29: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Challenges

• Resolved• IOS: Bootstrap responsive layout not adhering to width of device• Android: SVG images do not scale

• Open• Android: Scrolling broken at times• SF1: Long Visualforce pages jump to top• Fixed header

Page 30: Developer Guide: Turn Your Force.com Canvas App Into a Salesforce1 App

Visit us at booth #N2236Download the Developer Guide:

http://bit.ly/SF1devguidehttp://bit.ly/SF1devguide