Mobile sdk socialframework-df2012_v3


Published on

Published in: Technology, Business
1 Like
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • 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

    1. 1. Using Mobile SDK for iOS to buildSocial Enabled ApplicationsTwitter, Facebook, etc.Samuel Sharaf, Salesforce Mobile Team@ssharaf79
    2. 2. AgendaSocial Media IntegrationUse Cases – Chatter to Twitter/FacebookHigh Level Design StepsiOS v5 vs iOS v6 Social FrameworkintegrationDemo
    3. 3. 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.
    4. 4. The business case forsocial technologies
    5. 5. 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.
    6. 6. 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
    7. 7. Tweeting from Chatter to Social Frameworks
    8. 8. 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.
    9. 9. Architecture & OverviewSalesforce Mobile SDK for iOS,Oauth, REST API and iOS SDK
    10. 10. High Level Architecture StackNative Mobile Application (iPhone, iPad)Native Mobile Application (iPhone, iPad)Salesforce CloudSalesforce CloudRest APITwitter/Facebook APITwitter/Facebook APIOAuthOAuth
    11. 11. Get Salesforce Mobile SDK for iOSStep 1git clone ./ under SalesforceMobileSDK-iOSFurther Steps
    12. 12. OAuth Flow – Logical ArchitectureNative MobileAppNative MobileAppSalesforcePlatformSalesforcePlatformSends App CredentialsUser Logs in – Token sent toCall backConfirms TokenSend Access TokenMaintain Session withRefresh Token
    13. 13. OAuth Flow - Physical
    14. 14. 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
    15. 15. 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"]];
    16. 16. Using iOS v5 and v6 SDKIntegrating with Social Media
    17. 17. 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
    18. 18. iOS v5 – Sending Tweet – UI IntegrationCheck for service availability canSendTweetCreate a view controllerSupply a completion handlerPresent modally
    19. 19. 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]; }
    20. 20. iOS v5 - LimitationsLimited to TwitterOnly designed for modal presentation
    21. 21. iOS v6 – Extending social media support
    22. 22. Capabilities Offered by iOS v6Provides SLRequest, which can talk to:• Facebook• Twitter• Sina Weibo (1.0 only)Provides SLServiceTypes• SLServiceTypeFacebook;• SLServiceTypeTwitter;• SLServiceTypeSinaWeibo
    23. 23. iOS v6 – Social Media Integration OptionsTwo options General Social Media ViewController• UIActivityViewController Targeted Integration• SLComposeViewController
    24. 24. 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.
    25. 25. iOS v6 – Social Media Integration
    26. 26. iOS v6 - UIActivityViewController
    27. 27. iOS v6 - SLComposeViewController
    28. 28. 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];
    29. 29. 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”}
    30. 30. 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...}
    31. 31. Social Services Documentation SitesFacebook Weibo
    32. 32. Speaker NameSpeaker Title,@twitternameSpeaker NameSpeaker Title,@twitternameSpeaker Name Speaker NameSpeaker Title,@twitternameSpeaker Title,@twittername