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

Mobile sdk socialframework-df2012_v3

on

  • 559 views

 

Statistics

Views

Total Views
559
Views on SlideShare
550
Embed Views
9

Actions

Likes
1
Downloads
0
Comments
2

1 Embed 9

http://samuelsharaf.wordpress.com 9

Accessibility

Categories

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.

Cancel

12 of 2

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Code for the slides:
    https://github.com/samuelsharaf/DFFridaySessionDemo
    Are you sure you want to
    Your message goes here
    Processing…
  • 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
    Processing…
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 https://na1.salesforce.com/services/data/

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 salesforce.com, 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 non-salesforce.com products, and utilizationand selling to larger enterprise customers. Further information on potential factors that could affect the financial results ofsalesforce.com, 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. Salesforce.com, 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 clonehttps://github.com/forcedotcom/SalesforceMobileSDK-iOS.gitRun ./install.sh under SalesforceMobileSDK-iOSFurther Stepshttp://wiki.developerforce.com/page/Getting_Started_with_the_Mobile_SDK_for_iOS
  • 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 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 recordshttps://na1.salesforce.com/services/data/v25.0/sobjects/
  • 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”}https://graph.facebook.com/me
  • Accessing User’s Facebook ProfileNSURL *requestURL = [NSURL URLWithString:@"http://graph.facebook.com/me"];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 https://developers.facebook.com/docs/Sina Weibo http://open.weibo.com/wiki/Twitter https://dev.twitter.com/docs
  • Speaker NameSpeaker Title,@twitternameSpeaker NameSpeaker Title,@twitternameSpeaker Name Speaker NameSpeaker Title,@twitternameSpeaker Title,@twittername