SlideShare a Scribd company logo
Parse.com
Mobile app platform
By John Tubert
Why parse.com?
● Free (to start)
● No server needed
● Easy to use
● Multi-platform
How to get started
1. Create free account
2. Download SDK or blank xcode project
3. Start coding
How to really get started
1. Add framework to project
2. Add import statement to prefix file
a. #import <Parse/Parse.h>
3. Initialize parse on delegate file
a. [Parse setApplicationId:@"" clientKey:@""];
4. Add code to read or write to parse.com
Register/login users
Show LoginAndSignUpDemo
Write
PFObject *addressObject = [PFObject objectWithClassName:@"Addresses"];
[addressObject setObject:@"John Tubert" forKey:@"name"];
[addressObject setObject:@"350 west 39th Street" forKey:@"Address"];
[addressObject setObject:@"New York" forKey:@"City"];
[addressObject setObject:@"NY" forKey:@"State"];
[addressObject setObject:@"10018" forKey:@"Zip"];
[addressObject save];
Count
PFQuery *queryPhotoCount = [PFQuery queryWithClassName:@"Photo"];
[queryPhotoCount whereKey:kPAPPhotoUserKey equalTo:[PFUser
currentUser]];
[queryPhotoCount setCachePolicy:kPFCachePolicyCacheThenNetwork];
[queryPhotoCount countObjectsInBackgroundWithBlock:^(int number,
NSError *error) {
if (!error) {
NSLog(@"count: %i",number);
}
}];
Read
PFQuery *query = [PFQuery queryWithClassName:@"Addresses"];
[query setCachePolicy:kPFCachePolicyCacheThenNetwork];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError
*error) {
if (error) {
NSLog(@"error %@",error);
}else{
NSLog(@"objects %@",objects);
}
}];
Read (with constraints)
PFQuery *query = [PFQuery queryWithClassName:@"Addresses"];
[query whereKey:@"name" containsString:@"John"];
[query setCachePolicy:kPFCachePolicyCacheThenNetwork];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError
*error) {
if (error) {
NSLog(@"error %@",error);
}else{
NSLog(@"objects %@",objects);
}
}];
More constraints
Basic Constraints
- (void)includeKey:(NSString *)key;
- (void)whereKeyExists:(NSString *)key;
- (void)whereKeyDoesNotExist:(NSString *)key;
- (void)whereKey:(NSString *)key equalTo:(id)object;
- (void)whereKey:(NSString *)key lessThan:(id)object;
- (void)whereKey:(NSString *)key lessThanOrEqualTo:(id)object;
- (void)whereKey:(NSString *)key greaterThan:(id)object;
- (void)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object;
- (void)whereKey:(NSString *)key notEqualTo:(id)object;
- (void)whereKey:(NSString *)key containedIn:(NSArray *)array;
- (void)whereKey:(NSString *)key notContainedIn:(NSArray *)array;
Location Constraints
- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint;
- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinMiles:(double)maxDistance;
- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinKilometers:(double)maxDistance;
- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinRadians:(double)maxDistance;
- (void)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *)
northeast;
String Constraints
- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex;
- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex modifiers:(NSString *)modifiers;
- (void)whereKey:(NSString *)key containsString:(NSString *)substring;
- (void)whereKey:(NSString *)key hasPrefix:(NSString *)prefix;
- (void)whereKey:(NSString *)key hasSuffix:(NSString *)suffix;
Saving photos
PFObject *photo = [PFObject objectWithClassName:kPAPPhotoClassKey];
[photo setObject:[PFUser currentUser] forKey:kPAPPhotoUserKey];
[photo setObject:self.photoFile forKey:kPAPPhotoPictureKey];
[photo setObject:self.thumbnailFile forKey:kPAPPhotoThumbnailKey];
[photo save];
DEMO
Show ArchUp demo
Demo: using JS API
http://jtubert.com/sketchit/
Server side methods
(AKA: cloud code)
Parse.Cloud.define("hello", function(request, response) {
response.success("Hello Parse world!");
});
Getting started: Cloud code
Install the command line tool:
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
Create new project:
$ parse new MyCloudCode
Write functions:
Parse.Cloud.define("hello", function(request, response) {
response.success("Hello world!");
});
Deploy code:
$ parse deploy
Call methods from app:
[PFCloud callFunctionInBackground:@"hello" withParameters:@{} block:^(NSString *result, NSError
*error) {
if (!error) {
// result is @"Hello world!"
NSLog(@"%@",result);
}
}];
Questions/
Comments
THANKS
Ad

Recommended

Arp
Arp
Ebsil Sherly
 
Understanding GIT
Understanding GIT
hybr1s
 
Working with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSON
SV.CO
 
HeadCouch - CouchDB PHP Client
HeadCouch - CouchDB PHP Client
Dimitar Ivanov
 
Scala on Your Phone
Scala on Your Phone
Michael Galpin
 
Hydra - Getting Started
Hydra - Getting Started
abramsm
 
File Transfer Through Sockets
File Transfer Through Sockets
adil raja
 
Introduction to couch_db
Introduction to couch_db
Romain Testard
 
Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative
Samuel Barbosa
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
Aeric Poon
 
The Gist of React Native
The Gist of React Native
Darren Cruse
 
Developing Apps With React Native
Developing Apps With React Native
Alvaro Viebrantz
 
Florin React Native Meetup
Florin React Native Meetup
Sebastiaan de Vries
 
[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015
Kobkrit Viriyayudhakorn
 
React native - What, Why, How?
React native - What, Why, How?
Teerasej Jiraphatchandej
 
React Native
React Native
Software Infrastructure
 
React native redux_sharing
React native redux_sharing
Sam Lee
 
A tour of React Native
A tour of React Native
Tadeu Zagallo
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
React Native
React Native
Artyom Trityak
 
Intro to react native
Intro to react native
ModusJesus
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Workshop 22: ReactJS Redux Advanced
Workshop 22: ReactJS Redux Advanced
Visual Engineering
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
 
Intro To React Native
Intro To React Native
FITC
 
React Native for Web
React Native for Web
Sam Lee
 
React Native na globo.com
React Native na globo.com
Guilherme Heynemann Bruzzi
 
Introduction to Parse
Introduction to Parse
abeymm
 
Parse par Nicolas Lauquin
Parse par Nicolas Lauquin
CocoaHeads France
 
Introduction to Parse backend for mobile developers
Introduction to Parse backend for mobile developers
Grigor Yeghiazaryan
 

More Related Content

Viewers also liked (19)

Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative
Samuel Barbosa
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
Aeric Poon
 
The Gist of React Native
The Gist of React Native
Darren Cruse
 
Developing Apps With React Native
Developing Apps With React Native
Alvaro Viebrantz
 
Florin React Native Meetup
Florin React Native Meetup
Sebastiaan de Vries
 
[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015
Kobkrit Viriyayudhakorn
 
React native - What, Why, How?
React native - What, Why, How?
Teerasej Jiraphatchandej
 
React Native
React Native
Software Infrastructure
 
React native redux_sharing
React native redux_sharing
Sam Lee
 
A tour of React Native
A tour of React Native
Tadeu Zagallo
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
React Native
React Native
Artyom Trityak
 
Intro to react native
Intro to react native
ModusJesus
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Workshop 22: ReactJS Redux Advanced
Workshop 22: ReactJS Redux Advanced
Visual Engineering
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
 
Intro To React Native
Intro To React Native
FITC
 
React Native for Web
React Native for Web
Sam Lee
 
React Native na globo.com
React Native na globo.com
Guilherme Heynemann Bruzzi
 
Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative
Samuel Barbosa
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
Aeric Poon
 
The Gist of React Native
The Gist of React Native
Darren Cruse
 
Developing Apps With React Native
Developing Apps With React Native
Alvaro Viebrantz
 
[React Native Tutorial] Lecture 3: More on ES6/ES2015
[React Native Tutorial] Lecture 3: More on ES6/ES2015
Kobkrit Viriyayudhakorn
 
React native redux_sharing
React native redux_sharing
Sam Lee
 
A tour of React Native
A tour of React Native
Tadeu Zagallo
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
Intro to react native
Intro to react native
ModusJesus
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Workshop 22: ReactJS Redux Advanced
Workshop 22: ReactJS Redux Advanced
Visual Engineering
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
 
Intro To React Native
Intro To React Native
FITC
 
React Native for Web
React Native for Web
Sam Lee
 

Similar to Parse.com (20)

Introduction to Parse
Introduction to Parse
abeymm
 
Parse par Nicolas Lauquin
Parse par Nicolas Lauquin
CocoaHeads France
 
Introduction to Parse backend for mobile developers
Introduction to Parse backend for mobile developers
Grigor Yeghiazaryan
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
Persistencia de datos con Parse
Persistencia de datos con Parse
Alfonso Alba
 
Parsing in ios to create an app
Parsing in ios to create an app
HeaderLabs .
 
What's Parse
What's Parse
Tsutomu Ogasawara
 
Elements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
iOSDevCamp 2011 Core Data
iOSDevCamp 2011 Core Data
Chris Mar
 
NYU final project
NYU final project
Daniel Yoon
 
Developing iOS REST Applications
Developing iOS REST Applications
lmrei
 
DIY Uber
DIY Uber
NSCoder Mexico
 
WhereCamp EU talk: iPhone location 101
WhereCamp EU talk: iPhone location 101
Michael Dales
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy Development
Andrew Kozlik
 
Core Data with Swift 3.0
Core Data with Swift 3.0
Korhan Bircan
 
Introduction to Restkit
Introduction to Restkit
petertmarks
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
 
iphone presentation
iphone presentation
Dhananjay Fartyal
 
занятие8
занятие8
Oleg Parinov
 
iOS Core location
iOS Core location
Richa Jain
 
Introduction to Parse
Introduction to Parse
abeymm
 
Introduction to Parse backend for mobile developers
Introduction to Parse backend for mobile developers
Grigor Yeghiazaryan
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
Persistencia de datos con Parse
Persistencia de datos con Parse
Alfonso Alba
 
Parsing in ios to create an app
Parsing in ios to create an app
HeaderLabs .
 
Elements for an iOS Backend
Elements for an iOS Backend
Laurent Cerveau
 
iOSDevCamp 2011 Core Data
iOSDevCamp 2011 Core Data
Chris Mar
 
NYU final project
NYU final project
Daniel Yoon
 
Developing iOS REST Applications
Developing iOS REST Applications
lmrei
 
WhereCamp EU talk: iPhone location 101
WhereCamp EU talk: iPhone location 101
Michael Dales
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy Development
Andrew Kozlik
 
Core Data with Swift 3.0
Core Data with Swift 3.0
Korhan Bircan
 
Introduction to Restkit
Introduction to Restkit
petertmarks
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Chris Adamson
 
iOS Core location
iOS Core location
Richa Jain
 
Ad

More from John Tubert (8)

Sibling rivalry tech vs. philosophy on bias in ai
Sibling rivalry tech vs. philosophy on bias in ai
John Tubert
 
Sibling rivalry tech vs. philosophy on bias & AI
Sibling rivalry tech vs. philosophy on bias & AI
John Tubert
 
Extreme Danger of bias in Artificial Inteligence
Extreme Danger of bias in Artificial Inteligence
John Tubert
 
LeapMotion
LeapMotion
John Tubert
 
Sketchio presentation at Parse Developer meetup
Sketchio presentation at Parse Developer meetup
John Tubert
 
Browserless javascript testing
Browserless javascript testing
John Tubert
 
Drawing room experiment
Drawing room experiment
John Tubert
 
Bunch of random tech things
Bunch of random tech things
John Tubert
 
Sibling rivalry tech vs. philosophy on bias in ai
Sibling rivalry tech vs. philosophy on bias in ai
John Tubert
 
Sibling rivalry tech vs. philosophy on bias & AI
Sibling rivalry tech vs. philosophy on bias & AI
John Tubert
 
Extreme Danger of bias in Artificial Inteligence
Extreme Danger of bias in Artificial Inteligence
John Tubert
 
Sketchio presentation at Parse Developer meetup
Sketchio presentation at Parse Developer meetup
John Tubert
 
Browserless javascript testing
Browserless javascript testing
John Tubert
 
Drawing room experiment
Drawing room experiment
John Tubert
 
Bunch of random tech things
Bunch of random tech things
John Tubert
 
Ad

Recently uploaded (20)

Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 

Parse.com

  • 2. Why parse.com? ● Free (to start) ● No server needed ● Easy to use ● Multi-platform
  • 3. How to get started 1. Create free account 2. Download SDK or blank xcode project 3. Start coding
  • 4. How to really get started 1. Add framework to project 2. Add import statement to prefix file a. #import <Parse/Parse.h> 3. Initialize parse on delegate file a. [Parse setApplicationId:@"" clientKey:@""]; 4. Add code to read or write to parse.com
  • 6. Write PFObject *addressObject = [PFObject objectWithClassName:@"Addresses"]; [addressObject setObject:@"John Tubert" forKey:@"name"]; [addressObject setObject:@"350 west 39th Street" forKey:@"Address"]; [addressObject setObject:@"New York" forKey:@"City"]; [addressObject setObject:@"NY" forKey:@"State"]; [addressObject setObject:@"10018" forKey:@"Zip"]; [addressObject save];
  • 7. Count PFQuery *queryPhotoCount = [PFQuery queryWithClassName:@"Photo"]; [queryPhotoCount whereKey:kPAPPhotoUserKey equalTo:[PFUser currentUser]]; [queryPhotoCount setCachePolicy:kPFCachePolicyCacheThenNetwork]; [queryPhotoCount countObjectsInBackgroundWithBlock:^(int number, NSError *error) { if (!error) { NSLog(@"count: %i",number); } }];
  • 8. Read PFQuery *query = [PFQuery queryWithClassName:@"Addresses"]; [query setCachePolicy:kPFCachePolicyCacheThenNetwork]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (error) { NSLog(@"error %@",error); }else{ NSLog(@"objects %@",objects); } }];
  • 9. Read (with constraints) PFQuery *query = [PFQuery queryWithClassName:@"Addresses"]; [query whereKey:@"name" containsString:@"John"]; [query setCachePolicy:kPFCachePolicyCacheThenNetwork]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (error) { NSLog(@"error %@",error); }else{ NSLog(@"objects %@",objects); } }];
  • 10. More constraints Basic Constraints - (void)includeKey:(NSString *)key; - (void)whereKeyExists:(NSString *)key; - (void)whereKeyDoesNotExist:(NSString *)key; - (void)whereKey:(NSString *)key equalTo:(id)object; - (void)whereKey:(NSString *)key lessThan:(id)object; - (void)whereKey:(NSString *)key lessThanOrEqualTo:(id)object; - (void)whereKey:(NSString *)key greaterThan:(id)object; - (void)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object; - (void)whereKey:(NSString *)key notEqualTo:(id)object; - (void)whereKey:(NSString *)key containedIn:(NSArray *)array; - (void)whereKey:(NSString *)key notContainedIn:(NSArray *)array; Location Constraints - (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint; - (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinMiles:(double)maxDistance; - (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinKilometers:(double)maxDistance; - (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinRadians:(double)maxDistance; - (void)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *) northeast; String Constraints - (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex; - (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex modifiers:(NSString *)modifiers; - (void)whereKey:(NSString *)key containsString:(NSString *)substring; - (void)whereKey:(NSString *)key hasPrefix:(NSString *)prefix; - (void)whereKey:(NSString *)key hasSuffix:(NSString *)suffix;
  • 11. Saving photos PFObject *photo = [PFObject objectWithClassName:kPAPPhotoClassKey]; [photo setObject:[PFUser currentUser] forKey:kPAPPhotoUserKey]; [photo setObject:self.photoFile forKey:kPAPPhotoPictureKey]; [photo setObject:self.thumbnailFile forKey:kPAPPhotoThumbnailKey]; [photo save];
  • 13. Demo: using JS API http://jtubert.com/sketchit/
  • 14. Server side methods (AKA: cloud code) Parse.Cloud.define("hello", function(request, response) { response.success("Hello Parse world!"); });
  • 15. Getting started: Cloud code Install the command line tool: curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash Create new project: $ parse new MyCloudCode Write functions: Parse.Cloud.define("hello", function(request, response) { response.success("Hello world!"); }); Deploy code: $ parse deploy Call methods from app: [PFCloud callFunctionInBackground:@"hello" withParameters:@{} block:^(NSString *result, NSError *error) { if (!error) { // result is @"Hello world!" NSLog(@"%@",result); } }];