SlideShare a Scribd company logo
1 of 16
What’s Parse

Tsutomu Ogasawara
https://www.parse.com/
What’s Parse?
•   BaaS for iOS / Android
•   Quick Start / Minimum Configuration
•   Full Stack SDK
•   Rest API / JavaScript SDK
•   Useful Documentations / Tutorials
•   Freemium
Code Examples
Objective-C for iOS
PFObject*post = [PFObjectobjectWithClassName:@"Post"];
[post setObject:@"Hello World"forKey:@"title"];
[post setObject:@"I got Parse working on iOS!"forKey:@"content"];
[post saveInBackground];

Java for Android
ParseObjectpost = new ParseObject("Post");
post.put("title", "Hello World");
post.put("content", "I got Parse working on Android!");
post.saveInBackground();

JavaScript
varPost = Parse.Object.extend("Post");
varpost = new Post();
post.set("title", "Hello World");
post.set("content", "I got Parse working on Android!");
post.save(null, { success: function() {}, error: function() {} );
Structure
                             Data Storage




User Authentication
                                                       Push Notification




              Rest API
                                            iOS SDK
        JavaScript SDK
                                            Android SDK
                                            JavaScript SDK
Functions
•   Data Storage / File Storage
•   Push Notification Gateway
•   User Management
•   Geo Location Support
•   Facebook& Twitter
Data Storage / File Storage
• SQL-like simple Database (PFObject)
   – Schemaless row-column model
   – Working in the background
   – Spreadsheet-like Data browser on parse.com
   – Many ways to retrieve data
• File store (PFFile)
   – File storage up to 10MB per file.
   – Working in the background and get the progress.
   – Examples.
Save a photo
PFObject *photo = [PFObjectobjectWithClassName:@"Photo"];
PFUser *currentUser = [PFUsercurrentUser];
[photo setObject:currentUserforKey:@"user"];
[photo setObject:photoIDforKey:@"photo_id"];
[photo saveInBackgroundWithBlock:^(BOOLsucceeded, NSError *error) {
if( succeeded ) {
    }
    else {
    }
}];


Retrieve photos
PFQuery *query = [PFQueryqueryWithClassName:@"Photo"];
[query orderByDescending:@"updatedAt"];
[query findObjectsInBackgroundWithBlock:
                     ^(NSArray *objects, NSError *error) {
if( ! error ) {
    }
    else {
    }
}];
Push Notification (PFPush)
• Cross platform
  – iOS -> Android / Android ->iOS
  – Broadcast to both OS apps.
• Send from
  – Apps
  – REST API
  – Web console on parse.com
Subscribe push notification channel
PFUser *user = [PFUsercurrentUser];
NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId];
[PFPushsubscribeToChannelInBackground:channelblock:
                ^(BOOLsucceeded, NSError *error) {
    ...
}];

Send a notification
PFUser *user = [photoObjectobjectForKey:@"user"];
NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId];
NSString *commenter = [currentUser
valueForKeyPath:@"twitter_userdata.screen_name"];
NSString *alert = [NSStringstringWithFormat:
@"%@ さんがコメントしました。", commenter];
NSDictionary *data = [NSDictionarydictionaryWithObjectsAndKeys:
commentObject.objectId, @"comment",
photoObject.objectId, @"photo",
                alert, @"alert",
@"default", @"sound",
nil];
[PFPushsendPushDataToChannelInBackground:channelwithData:data];
User Management (PFUser)
• Original Signup and Login
  – Email address verification
  – Resetting Password
  – User Interfaces
• Login with Facebook& Twitter
• Security
  – Access Control List (PFACL)
  – Role-based Access Control (PFRole)
Geo Location (PFGeoPoint)
• Store a geo location data in PFObject
• Query objects
  – ordered by distance.
  – within miles / km / radians
  – within rectangle from south-west to north-east
• Examples
Facebook& Twitter
• Authentication
• Libralies
  – PF_Facebook which is the wrapper of
    FacebookiOS SDK
  – PF_Twitter which calls Twitter REST API
Facebook login
- (IBAction)pressLoginButton:(id)sender {
NSArray *permissions = [[NSArrayalloc] initWithObjects:
                        @"user_likes", @"read_stream”, nil];
    // Switch Facebook app or open facebook login page in Safari
    [PFFacebookUtilslogInWithPermissions:permissions block:
                          ^(PFUser *user, NSError *error) {
if( user && ! error ) {
         // logged in with Facebook
}
    }];
}


Twitter login
- (IBAction)pressLoginButton:(id)sender {
// Call Twitter login dialog
    [PFTwitterUtilslogInWithBlock:^(PFUser *user, NSError *error) {
if( user && ! error ) {
         // logged in with Twitter
}
    }];
}
Twitter API call with authentication
// generate request object
NSURL *url = [NSURLURLWithString:
@"https://api.twitter.com/1/account/verify_credentials.json"];
NSMutableURLRequest *request = [NSMutableURLRequestrequestWithURL:url];

// sign the request with auth user
PF_Twitter *twitter = [PFTwitterUtilstwitter];
[twitter signRequest:request];

// send request
NSURLResponse *response = nil;
NSError *error = nil;
NSData *data = [NSURLConnectionsendSynchronousRequest:request
returningResponse:&response
error:&error];
if( data ) {
// save user info
NSDictionary *jsonObjects = [NSJSONSerialization
JSONObjectWithData:data
options:NSJSONReadingMutableContainers
error:&error];
}
Thanks!

More Related Content

What's hot

Search APIs in Spotlight and Safari
Search APIs in Spotlight and SafariSearch APIs in Spotlight and Safari
Search APIs in Spotlight and Safari
Yusuke Kita
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - Altran
Robert Nyman
 

What's hot (20)

Diving into php
Diving into phpDiving into php
Diving into php
 
Html indexed db
Html indexed dbHtml indexed db
Html indexed db
 
Cloudbase.io MoSync Reload Course
Cloudbase.io MoSync Reload CourseCloudbase.io MoSync Reload Course
Cloudbase.io MoSync Reload Course
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017
 
iOS5 NewStuff
iOS5 NewStuffiOS5 NewStuff
iOS5 NewStuff
 
The effective use of Django ORM
The effective use of Django ORMThe effective use of Django ORM
The effective use of Django ORM
 
Search APIs in Spotlight and Safari
Search APIs in Spotlight and SafariSearch APIs in Spotlight and Safari
Search APIs in Spotlight and Safari
 
ABCD firebase
ABCD firebaseABCD firebase
ABCD firebase
 
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
 Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011 Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
Be lazy, be ESI: HTTP caching and Symfony2 @ PHPDay 2011 05-13-2011
 
How to make workout app for watch os 2
How to make workout app for watch os 2How to make workout app for watch os 2
How to make workout app for watch os 2
 
Whats new in iOS5
Whats new in iOS5Whats new in iOS5
Whats new in iOS5
 
Mongo db for C# Developers
Mongo db for C# DevelopersMongo db for C# Developers
Mongo db for C# Developers
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 
Mongo db for c# developers
Mongo db for c# developersMongo db for c# developers
Mongo db for c# developers
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloud
 
HTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - AltranHTML5 APIs - Where no man has gone before! - Altran
HTML5 APIs - Where no man has gone before! - Altran
 
Webinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaWebinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and Morphia
 
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK -  Nicola Iarocci - Co...
RESTFUL SERVICES MADE EASY: THE EVE REST API FRAMEWORK - Nicola Iarocci - Co...
 
Servlets intro
Servlets introServlets intro
Servlets intro
 

Viewers also liked

Viewers also liked (8)

CakePHP 事例紹介 @ogaoga
CakePHP 事例紹介 @ogaogaCakePHP 事例紹介 @ogaoga
CakePHP 事例紹介 @ogaoga
 
Cutting edge of web technology
Cutting edge of web technologyCutting edge of web technology
Cutting edge of web technology
 
Html5 in Rakuten (at HTML5 Experts Night#1) #html5exp
Html5 in Rakuten (at HTML5 Experts Night#1) #html5expHtml5 in Rakuten (at HTML5 Experts Night#1) #html5exp
Html5 in Rakuten (at HTML5 Experts Night#1) #html5exp
 
スマートフォンアプリケーション開発の最新動向
スマートフォンアプリケーション開発の最新動向スマートフォンアプリケーション開発の最新動向
スマートフォンアプリケーション開発の最新動向
 
オープンソースを活用したフロントエンド開発の取り組み
オープンソースを活用したフロントエンド開発の取り組みオープンソースを活用したフロントエンド開発の取り組み
オープンソースを活用したフロントエンド開発の取り組み
 
空室検索 Map
空室検索 Map空室検索 Map
空室検索 Map
 
楽天の e コマースと HTML5 活用事例
楽天の e コマースと HTML5 活用事例楽天の e コマースと HTML5 活用事例
楽天の e コマースと HTML5 活用事例
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to What's Parse

iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
Meetup uikit programming
Meetup uikit programmingMeetup uikit programming
Meetup uikit programming
joaopmaia
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
Petr Dvorak
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
Piotr Pasich
 

Similar to What's Parse (20)

Introduction to Parse
Introduction to ParseIntroduction to Parse
Introduction to Parse
 
Introduction to Parse backend for mobile developers
Introduction to Parse backend for mobile developersIntroduction to Parse backend for mobile developers
Introduction to Parse backend for mobile developers
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
Parse: 5 tricks that won YC Hacks
Parse: 5 tricks that won YC HacksParse: 5 tricks that won YC Hacks
Parse: 5 tricks that won YC Hacks
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
Meetup uikit programming
Meetup uikit programmingMeetup uikit programming
Meetup uikit programming
 
Persistencia de datos con Parse
Persistencia de datos con ParsePersistencia de datos con Parse
Persistencia de datos con Parse
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentLeveraging parse.com for Speedy Development
Leveraging parse.com for Speedy Development
 
занятие8
занятие8занятие8
занятие8
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
Parse par Nicolas Lauquin
Parse par Nicolas LauquinParse par Nicolas Lauquin
Parse par Nicolas Lauquin
 
Legacy applications - 4Developes konferencja, Piotr Pasich
Legacy applications  - 4Developes konferencja, Piotr PasichLegacy applications  - 4Developes konferencja, Piotr Pasich
Legacy applications - 4Developes konferencja, Piotr Pasich
 
Rapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and FirebaseRapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and Firebase
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQL
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

What's Parse

  • 3. What’s Parse? • BaaS for iOS / Android • Quick Start / Minimum Configuration • Full Stack SDK • Rest API / JavaScript SDK • Useful Documentations / Tutorials • Freemium
  • 4. Code Examples Objective-C for iOS PFObject*post = [PFObjectobjectWithClassName:@"Post"]; [post setObject:@"Hello World"forKey:@"title"]; [post setObject:@"I got Parse working on iOS!"forKey:@"content"]; [post saveInBackground]; Java for Android ParseObjectpost = new ParseObject("Post"); post.put("title", "Hello World"); post.put("content", "I got Parse working on Android!"); post.saveInBackground(); JavaScript varPost = Parse.Object.extend("Post"); varpost = new Post(); post.set("title", "Hello World"); post.set("content", "I got Parse working on Android!"); post.save(null, { success: function() {}, error: function() {} );
  • 5. Structure Data Storage User Authentication Push Notification Rest API iOS SDK JavaScript SDK Android SDK JavaScript SDK
  • 6. Functions • Data Storage / File Storage • Push Notification Gateway • User Management • Geo Location Support • Facebook& Twitter
  • 7. Data Storage / File Storage • SQL-like simple Database (PFObject) – Schemaless row-column model – Working in the background – Spreadsheet-like Data browser on parse.com – Many ways to retrieve data • File store (PFFile) – File storage up to 10MB per file. – Working in the background and get the progress. – Examples.
  • 8. Save a photo PFObject *photo = [PFObjectobjectWithClassName:@"Photo"]; PFUser *currentUser = [PFUsercurrentUser]; [photo setObject:currentUserforKey:@"user"]; [photo setObject:photoIDforKey:@"photo_id"]; [photo saveInBackgroundWithBlock:^(BOOLsucceeded, NSError *error) { if( succeeded ) { } else { } }]; Retrieve photos PFQuery *query = [PFQueryqueryWithClassName:@"Photo"]; [query orderByDescending:@"updatedAt"]; [query findObjectsInBackgroundWithBlock: ^(NSArray *objects, NSError *error) { if( ! error ) { } else { } }];
  • 9. Push Notification (PFPush) • Cross platform – iOS -> Android / Android ->iOS – Broadcast to both OS apps. • Send from – Apps – REST API – Web console on parse.com
  • 10. Subscribe push notification channel PFUser *user = [PFUsercurrentUser]; NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId]; [PFPushsubscribeToChannelInBackground:channelblock: ^(BOOLsucceeded, NSError *error) { ... }]; Send a notification PFUser *user = [photoObjectobjectForKey:@"user"]; NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId]; NSString *commenter = [currentUser valueForKeyPath:@"twitter_userdata.screen_name"]; NSString *alert = [NSStringstringWithFormat: @"%@ さんがコメントしました。", commenter]; NSDictionary *data = [NSDictionarydictionaryWithObjectsAndKeys: commentObject.objectId, @"comment", photoObject.objectId, @"photo", alert, @"alert", @"default", @"sound", nil]; [PFPushsendPushDataToChannelInBackground:channelwithData:data];
  • 11. User Management (PFUser) • Original Signup and Login – Email address verification – Resetting Password – User Interfaces • Login with Facebook& Twitter • Security – Access Control List (PFACL) – Role-based Access Control (PFRole)
  • 12. Geo Location (PFGeoPoint) • Store a geo location data in PFObject • Query objects – ordered by distance. – within miles / km / radians – within rectangle from south-west to north-east • Examples
  • 13. Facebook& Twitter • Authentication • Libralies – PF_Facebook which is the wrapper of FacebookiOS SDK – PF_Twitter which calls Twitter REST API
  • 14. Facebook login - (IBAction)pressLoginButton:(id)sender { NSArray *permissions = [[NSArrayalloc] initWithObjects: @"user_likes", @"read_stream”, nil]; // Switch Facebook app or open facebook login page in Safari [PFFacebookUtilslogInWithPermissions:permissions block: ^(PFUser *user, NSError *error) { if( user && ! error ) { // logged in with Facebook } }]; } Twitter login - (IBAction)pressLoginButton:(id)sender { // Call Twitter login dialog [PFTwitterUtilslogInWithBlock:^(PFUser *user, NSError *error) { if( user && ! error ) { // logged in with Twitter } }]; }
  • 15. Twitter API call with authentication // generate request object NSURL *url = [NSURLURLWithString: @"https://api.twitter.com/1/account/verify_credentials.json"]; NSMutableURLRequest *request = [NSMutableURLRequestrequestWithURL:url]; // sign the request with auth user PF_Twitter *twitter = [PFTwitterUtilstwitter]; [twitter signRequest:request]; // send request NSURLResponse *response = nil; NSError *error = nil; NSData *data = [NSURLConnectionsendSynchronousRequest:request returningResponse:&response error:&error]; if( data ) { // save user info NSDictionary *jsonObjects = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; }