Weitere ähnliche Inhalte Ähnlich wie Going Offline with Salesforce1 Mobile SDK (20) Mehr von WinWire Technologies Inc (20) Kürzlich hochgeladen (20) Going Offline with Salesforce1 Mobile SDK1. Going Offline with
Salesforce1 Mobile SDK
Notes:
If you experience audio issues during the webinar, you can dial in through
telephone details provided to you in your registration confirmation email.
Please feel free to post questions in the questions dialog and we will try to
answer as many as we can at the end.
Recording of this session will be shared in next 24-48 hours.
You can also write to us at marketing@winwire.com for any clarifications or
information.
2. © 2015 WinWire Technologies
Session Speaker
Ahmed Hassan
Director – Digital Customer Experience
ahmed.hassan@winwire.com
@ahmed4customers
3. © 2015 WinWire Technologies
Agenda
Salesforce1, HTML5 and Hybrid
Salesforce Mobile SDK Architecture and Related Best Practices
Offline Salesforce Mobility Options
Need for Going Offline
Use Cases and Related Solutions for Taking Salesforce Mobile Offline
1
2
3
4
5
4. © 2015 WinWire Technologies
Need for Being Mobile but Working Offline
Often there is no cellular
and/or wi-fi signal, yet
there is a need to capture
and update information in
Salesforce via a mobile
device.
How can users continue to be productive even if their device is not online?
5. © 2015 WinWire Technologies
Offline Salesforce Mobility Options
Option
CRUD
Capability
Requires
Mobile
SDK?
Requires
Additional
Tools/
Frameworks?
Requires
VisualForce/
Apex
Mobile SDK (Native iOS
or Android)
Read/Write Yes No No
Salesforce1 Read-only No No No
HTML5 Read/Write No Yes Yes
Hybrid Read/Write Yes No Yes
6. © 2015 WinWire Technologies
Salesforce Mobile SDK Offline Capabilities
Native platform capabilities are
available and can be integrated with
Salesforce using APIs in the Mobile
SDK
Ability to view,
create and edit
data while
offline
Data on device
is encrypted
and secure
7. © 2015 WinWire Technologies
SmartStore encrypted database
SmartSync data management
Enterprise identity & security
OS UI Frameworks
push notifications container REST API files mdm policies
Mobile SDK Components
Native Hybrid
8. © 2015 WinWire Technologies
SmartStore encrypted database
SmartSync data management
Enterprise identity & security
OS UI Frameworks
push notifications container REST API files mdm policies
Mobile SDK: Going Offline
Native Hybrid
9. © 2015 WinWire Technologies
Salesforce and Mobile SDK Architecture (for Going Offline)
Salesforce App Cloud
Custom App using Salesforce Mobile SDK
SmartStore
Smart
Sync
Connected App
Sales Cloud
(or any other App in
Salesforce App Cloud)
Identity &
Security
REST APIs
Online and Offline User
Input
Mobile Device
10. © 2015 WinWire Technologies
Mobile SDK: Connected App
Also enables
restricting the
Connected App to
only certain objects
in Salesforce.
Enables the Admin
and Developer to
enable or restrict
access by users, and
even by IP addresses.
As an admin - Use
connected apps with
user provisioning to
create, update, and
delete user accounts in
third-party applications
11. © 2015 WinWire Technologies
Mobile SDK: Identity & Security
Logging into the Mobile app
requires being online, even if
later on the user intends to go
offline
Connected apps use standard
SAML and OAuth protocols to
authenticate - Provide Single
Sign-On, and tokens used by
Salesforce APIs
A form in the app captures the
username and password, and
passes it to Salesforce for
authentication
Upon authentication from
Salesforce, the device is issued
a token with an expiration
If the user is using the app while
the token expires, a new one is
requested & issued
automatically without having to
re-enter login credentials. This
requires being online
If the user is not using the
application while the token
expires, the user is automatically
logged out
It is possible to control how
long the tokens last, but they
must expire
PIN Authentication (via a
mobile policy) is also an
option that can be enabled
12. © 2015 WinWire Technologies
Mobile SDK: SmartStore
SmartStore data is volatile! Its lifespan is tied to
the authenticated user and to OAuth token
states.
SmartStore is available in native or hybrid
development only, not HTML5.
• SmartStore stores data as
JSON documents in a
simple, single-table
database.
• In hybrid Android apps,
SmartStore must be
explicitly added
• SmartStore lets you store
app data in encrypted
databases, or soups, on
the device.
• When the device goes
back online, you can
synchronize data changes
using SmartSync.
13. © 2015 WinWire Technologies
Mobile SDK: SmartStore
Smart Store Data Types SmartStore Inspector
Develop Use Cases Develop Use Cases
• Integer (4 bytes in SDK 2.1 and earlier,
8 bytes in SDK 2.2 and later)
• Floating point value, 8-byte floating
point number
• Text string, stored with UTF-8
`
• A mobile UI used to test and debug
your code and ensure it is handling
SmartStore data as intended.
• Examine soup metadata, such as soup
names and index specs for any soup
• Clear a soup’s contents
• Perform Smart SQL queries
• All references to SmartStore Inspector
must be removed before final app
deployment.
14. © 2015 WinWire Technologies
Mobile SDK: SmartSync
• Data framework that provides a mechanism
for easily fetching Salesforce data, modeling
it as JavaScript objects, and caching it for
offline use.
• SmartSync is built on the popular
Backbone.js open source library & uses
SmartStore as its default cache.
• During offline upload, SmartSync gives you
highly granular control over the
synchronization process. This includes
resolving conflicts with data on the Server.
• Sync Manager provides APIs for
sycnchronizing large batches of data
between SmartStore and the server
• Metadata Manager performs data loading
functions to handle more full-featured
queries
• Cache Manager reads and writes to the
SmartStore db.
• SOQL Builder enables querying offline data
• SOSL Builder enables searching offline data
SmartSync ComponentsSmartSync
15. © 2015 WinWire Technologies
Mobile SDK: Salesforce Restful APIs
Stateless, designed
for Mobile and
Web 2.0
Supports JSON &
XML messaging
formats & HTTP1.1
compression
Uses HTTP
methods (HEAD,
GET, POST, PATCH,
DELETE)
Salesforce API
limits apply to Rest
API calls
Uses OAuth 2.0 for
authentication
Not designed for
transacting large
number of records
simultaneously
Provides powerful, convenient and simple Web services API for interacting
with Force.com. Commonly used for integration with Salesforce, even in
non-mobile contexts
16. © 2015 WinWire Technologies
Mobile SDK: Best Practices
Sequence of objects syncing (up or down) can be controlled by the app and becomes
relevant if creating related data (e.g. Opportunity Contacts).
Sync-down and Sync-up are all through the SmartStore
SmartStore provides 6 mobile-specific meta-data fields to help keep track of what’s been
synchronized with Salesforce online and what’s not: (Created, Last Updated, Last Synced)
Salesforce Ids are not generated in offline mode – if ids are required offline use
SmartStore Ids, which are auto-generated
Meta-objects are also available and should be used to avoid re-creating Salesforce
configuration
Salesforce permissions are put into effect by syncing down the meta-data required for
your application (based on the objects you’re exposing) and Connected App settings.
17. © 2015 WinWire Technologies
Additional Options
Salesforce1 HybridHTML5
18. © 2015 WinWire Technologies
Salesforce1
Salesforce’s pre-built app,
available on iOS and Android
Technical Considerations
• Can only view recently viewed
data cached on device (that was
viewed)
• Create, update and delete not
allowed
Features & Benefits
• Deliver employee focused
application
• Extend/Customize Salesforce1
user experience
• Reach users on multiple platforms
and devices
• Leverage standard lightning
components
• Mobile development expertise
not required
• Available for all Salesforce
editions
19. © 2015 WinWire Technologies
HTML5
Latest HTML markup language,
browser-based
Technical Considerations
• Custom VF/Apex page
development required to deliver
HTML content
• Offline capabilities only available
using additional components in
concert
• Encrypted capabilities to store
offline require purchase of licenses.
• HTML5 can only emulate the look
and feel of an app built on the
native device but will likely not
perform as well – this can impact
user experience.
Features & Benefits
• Broadest possible reach across
different device platforms, but a
multi-device strategy is required
at the coding level
• Browser based development
tools (instead of native,
device/platform specific tools)
• User experience is best when
online
20. © 2015 WinWire Technologies
Hybrid
Features and Benefits
• Hybrid apps combine the ease of
HTML5 Web app development with
the power and features of the
native platform
Hybrid Apps are Salesforce
“containers” built in each native
platform (iOS and Android) that run
HTML5 in the container. Two Types
Local: Use Forcetk, a JavaScript
library that wraps a Web app inside
the mobile container. These apps
store HTML, JavaScript and CSS files
on the device where the container
runs. Use REST APIs and Ajax to
move data between Server and the
device.
Remote: Developed with VF to
deliver Apex pages through the
mobile container. HTML, JavaScript
and CSS files are either on Salesforce
and the full application is
downloaded from the server to be
displayed in a browser window.
Technical Considerations for going
offline
• SmartStore and SmartSync can be
used, however requires an extra
step to be enabled in hybrid
Android.
• Salesforce Hybrid Containers are
built using Appache Cordova 3.6.x
and use the Salesforce Mobile SDK
as a Cordova plug-in.
• For Hybrid Remote apps, an Apex
landing page to point to is
required.
21. © 2015 WinWire Technologies
Use Cases and Related Solutions for Going Offline with Salesforce
Use Case
No.
Use Case Description Solution
1 Sales Rep needs to view Opportunities and
Contacts while offline. Target user base has
iPhones and Android devices.
Salesforce1 Mobile App
2 Sales Rep needs to create Contacts while offline.
Target user base has iPhones and Android devices
and requires a compelling user-experience.
Separate Native Apps on both
iOS and Android
3 Mobile app that tracks deliveries for sales, service
and operations. Some users have Windows smart
phones and need to access while offline
temporarily due to poor signals in the field. Most
users have iOS or Android
HTML5
4 Empower entire organization to collaborate and
swarm every case from anywhere. Most users are
on iPhone, but some are on Android.
Organization doesn’t have extensive capabilities to
support Android.
Hybrid
22. Who We Are
IT solutions company
making information
actionable for the
enterprises in the
mobile-cloud world
Collaborative and
Analytics solutions
leveraging pre-built
solution accelerators
Cloud,
Collaboration &
Analytics Technologies
Mobility,