New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Mobile sdk socialframework-df2012_v3
1. Using Mobile SDK for iOS to build
Social Enabled Applications
Twitter, Facebook, etc.
Samuel Sharaf, Salesforce Mobile Team
@ssharaf79
2. Agenda
Social Media Integration
Use Cases – Chatter to Twitter/Facebook
High Level Design Steps
iOS v5 vs iOS v6 Social Framework
integration
Demo
3. Safe harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of
intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we
operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new
releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization
and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of
salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This
documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of
our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based
upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
looking statements.
5. The social economy: Unlocking value and
productivity through social technologies
According to an analysis of 4,200 companies by Mckinsey,
social technologies stand to unlock from $900 billion to $1.3
trillion in value
Google, Microsoft, Salesforce, Adobe, Facebook and Oracle
have spent upward of $2.5 billion snatching up social media
tools to add to their enterprise suites.
6. Salesforce Chatter
Ability to tweet feed items and comments which have been
authorized by the owner as ‘tweet-able’.
Example – Marc Benioff message to tweet about Dreamforce for
internal employees
8. Example Use Case
Using Mobile SDK integrated with Salesforce Platform to build a
marketing mobile app for advertising agency.
Company has been using CRM and Chatter Desktop and would
like to expand their reach & messaging to millions of users
worldwide.
10. High Level Architecture Stack
Native Mobile Application (iPhone, iPad)Native Mobile Application (iPhone, iPad)
Salesforce CloudSalesforce Cloud
Rest API
Twitter/Facebook APITwitter/Facebook API
OAuth
OAuth
11. Get Salesforce Mobile SDK for iOS
Step 1
git clone
https://github.com/forcedotcom/SalesforceMobileSDK-iOS.git
Run ./install.sh under SalesforceMobileSDK-iOS
Further Steps
http://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_iOS
12. OAuth Flow – Logical Architecture
Native Mobile
App
Native Mobile
App
Salesforce
Platform
Salesforce
Platform
Sends App Credentials
User Logs in – Token sent to
Call back
Confirms Token
Send Access Token
Maintain Session with
Refresh Token
14. Salesforce Connect API
• Use Rest based Connect API for interaction with Force.com
• Each Resource in Force.com REST API is a named URI –
accessible using HEAD, GET, POST, PATCH or DELETE.
• Examples:
• Get user feed, followers, following etc.
• Perform a query or search
• Update or delete records
https://na1.salesforce.com/services/data/v25.0/sobjects/
15. Example of using Chatter REST API
The following code snippet uses the 'me' keyword to retrieve the
current users news feed:
NSString *res_url = [NSString
stringWithFormat:@"%@/services/data/v22.0/chatter/feeds/new
s/me/feed-items", [auth.parameters
objectForKey:@"instance_url"]];
16. Using iOS v5 and v6 SDK
Integrating with Social Media
17. iOS v5 Social Media Support
• Starting with iOS v5 Apple provided Twitter Framework built in
the SDK
• TWTweetComposeViewController inherits from UIViewController
and provides a very simple mechanism to tweet
18. iOS v5 – Sending Tweet – UI Integration
Check for service availability
canSendTweet
Create a view controller
Supply a completion handler
Present modally
22. Capabilities Offered by iOS v6
Provides SLRequest, which can talk to:
• Facebook
• Twitter
• Sina Weibo (1.0 only)
Provides SLServiceTypes
• SLServiceTypeFacebook;
• SLServiceTypeTwitter;
• SLServiceTypeSinaWeibo
23. iOS v6 – Social Media Integration Options
Two options
General Social Media ViewController
• UIActivityViewController
Targeted Integration
• SLComposeViewController
24. iOS v6 - Social Framework Usage Pattern
A common way to use this framework is:
•Create a network session.
•Get the activity feed for a user.
•Make a new post.
•Set properties on a post, add attachments, etc.
•Publish a post to an activity feed.
Utilizes the same underlying data model and standard objects as SOAP API. e.g. to retrieve rest api service info including version use https://na1.salesforce.com/services/data/