Mobile sdk socialframework-df2012_v3
Upcoming SlideShare
Loading in...5

Mobile sdk socialframework-df2012_v3






Total Views
Views on SlideShare
Embed Views



1 Embed 9 9



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.


12 of 2

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Code for the slides:
    Are you sure you want to
    Your message goes here
  • Using Salesforce mobile SDK to build social enabled apps for businesses utilizing Salesforce Chatter. This presentation takes a hands on approach on utilizing iOS v6 social framework, Salesforce Mobile SDK and Chatter REST API to demonstrate building a sample app which allows users to tweet directly from their chatter feeds.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Utilizes the same underlying data model and standard objects as SOAP API. e.g. to retrieve rest api service info including version use

Mobile sdk socialframework-df2012_v3 Mobile sdk socialframework-df2012_v3 Presentation Transcript

  • Using Mobile SDK for iOS to buildSocial Enabled ApplicationsTwitter, Facebook, etc.Samuel Sharaf, Salesforce Mobile Team@ssharaf79
  • AgendaSocial Media IntegrationUse Cases – Chatter to Twitter/FacebookHigh Level Design StepsiOS v5 vs iOS v6 Social FrameworkintegrationDemo
  • Safe harborSafe 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 uncertaintiesmaterialize or if any of the assumptions proves incorrect, the results of, inc. could differ materially from the resultsexpressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could bedeemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or otherfinancial items and any statements regarding strategies or plans of management for future operations, statements of belief, anystatements 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 newfunctionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in ouroperating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome ofintellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which weoperate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, newreleases of our service and successful customer deployment, our limited history reselling products, and utilizationand selling to larger enterprise customers. Further information on potential factors that could affect the financial results, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. Thisdocuments and others containing important disclosures are available on the SEC Filings section of the Investor Information section ofour Web site.Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currentlyavailable and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions basedupon features that are currently available., inc. assumes no obligation and does not intend to update these forward-looking statements.
  • The business case forsocial technologies
  • The social economy: Unlocking value andproductivity through social technologiesAccording to an analysis of 4,200 companies by Mckinsey,social technologies stand to unlock from $900 billion to $1.3trillion in valueGoogle, Microsoft, Salesforce, Adobe, Facebook and Oraclehave spent upward of $2.5 billion snatching up social mediatools to add to their enterprise suites.
  • Salesforce ChatterAbility to tweet feed items and comments which have beenauthorized by the owner as ‘tweet-able’.Example – Marc Benioff message to tweet about Dreamforce forinternal employees
  • Tweeting from Chatter to Social Frameworks
  • Example Use CaseUsing Mobile SDK integrated with Salesforce Platform to build amarketing mobile app for advertising agency.Company has been using CRM and Chatter Desktop and wouldlike to expand their reach & messaging to millions of usersworldwide.
  • Architecture & OverviewSalesforce Mobile SDK for iOS,Oauth, REST API and iOS SDK
  • High Level Architecture StackNative Mobile Application (iPhone, iPad)Native Mobile Application (iPhone, iPad)Salesforce CloudSalesforce CloudRest APITwitter/Facebook APITwitter/Facebook APIOAuthOAuth
  • Get Salesforce Mobile SDK for iOSStep 1git clone ./ under SalesforceMobileSDK-iOSFurther Steps
  • OAuth Flow – Logical ArchitectureNative MobileAppNative MobileAppSalesforcePlatformSalesforcePlatformSends App CredentialsUser Logs in – Token sent toCall backConfirms TokenSend Access TokenMaintain Session withRefresh Token
  • OAuth Flow - Physical
  • Salesforce Connect API• Use Rest based Connect API for interaction with• Each Resource in 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
  • Example of using Chatter REST APIThe following code snippet uses the me keyword to retrieve thecurrent users news feed:NSString *res_url = [NSStringstringWithFormat:@"%@/services/data/v22.0/chatter/feeds/news/me/feed-items", [auth.parametersobjectForKey:@"instance_url"]];
  • Using iOS v5 and v6 SDKIntegrating with Social Media
  • iOS v5 Social Media Support• Starting with iOS v5 Apple provided Twitter Framework built inthe SDK• TWTweetComposeViewController inherits from UIViewControllerand provides a very simple mechanism to tweet
  • iOS v5 – Sending Tweet – UI IntegrationCheck for service availability canSendTweetCreate a view controllerSupply a completion handlerPresent modally
  • iOS v5 – Using TWTweetComposeViewController- (void)tweetThis:(id)sender{- self.tweetController = [[TWTweetComposeViewController alloc] init];- [self.tweetController setInitialText:@"Tweeting Tweeting!"];- [self.tweetController setTitle:@"Tweet Please"];- [self.tweetController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {- NSString *output;- switch (result) {- case TWTweetComposeViewControllerResultCancelled:- output = @"Tweet Cancelled";- break;- case TWTweetComposeViewControllerResultDone:- output = @"Tweet Done";- break;- default:break;- }- // Dismiss the tweet compose view controller- [self.navController dismissModalViewControllerAnimated:YES]; }];- [self.navController presentModalViewController:self.tweetController animated:YES]; }
  • iOS v5 - LimitationsLimited to TwitterOnly designed for modal presentation
  • iOS v6 – Extending social media support
  • Capabilities Offered by iOS v6Provides SLRequest, which can talk to:• Facebook• Twitter• Sina Weibo (1.0 only)Provides SLServiceTypes• SLServiceTypeFacebook;• SLServiceTypeTwitter;• SLServiceTypeSinaWeibo
  • iOS v6 – Social Media Integration OptionsTwo options General Social Media ViewController• UIActivityViewController Targeted Integration• SLComposeViewController
  • iOS v6 - Social Framework Usage PatternA 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.
  • iOS v6 – Social Media Integration
  • iOS v6 - UIActivityViewController
  • iOS v6 - SLComposeViewController
  • iOS v6 – Example Facebook UI IntegrationSLComposeViewController *facebookPostVC = [SLComposeViewControllercomposeViewControllerForServiceType:SLServiceTypeFacebook];[facebookPostVC setInitialText:@”Hello Dreamforce"];[facebookPostVC addImage:[UIImage imageNamed:@"ge.png"]];[self.navigationController presentViewController:facebookPostVC animated:YEScompletion:nil];
  • iOS v6 – Facebook AccessYour Mobile AppYour Mobile App Twitter ServerTwitter Server{“id” = “12345”“name” = “Samuel Sharaf”“firstname” = “Samuel”“lastname” = “Sharaf”“username” = “ssharaf”“gender” = “male”“locale” = “en_US”}
  • Accessing User’s Facebook ProfileNSURL *requestURL = [NSURL URLWithString:@""];SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebookrequestMethod:SLRequestMethodGETURL: requestURLparameters:nil];request.account = self.facebookAccount;[request performRequestWithHander:^(NSData *data,NSHTTPURLResponse *response,NSError *error)] {// Handle the response here...}
  • Social Services Documentation SitesFacebook Weibo
  • Speaker NameSpeaker Title,@twitternameSpeaker NameSpeaker Title,@twitternameSpeaker Name Speaker NameSpeaker Title,@twitternameSpeaker Title,@twittername