• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Parse.com
 

Parse.com

on

  • 1,030 views

 

Statistics

Views

Total Views
1,030
Views on SlideShare
992
Embed Views
38

Actions

Likes
1
Downloads
18
Comments
0

3 Embeds 38

http://jtubert.wordpress.com 34
http://www.linkedin.com 2
http://jtubert.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Parse.com Parse.com Presentation Transcript

    • Parse.comMobile app platformBy John Tubert
    • Why parse.com?● Free (to start)● No server needed● Easy to use● Multi-platform
    • How to get started1. Create free account2. Download SDK or blank xcode project3. Start coding
    • How to really get started1. Add framework to project2. Add import statement to prefix filea. #import <Parse/Parse.h>3. Initialize parse on delegate filea. [Parse setApplicationId:@"" clientKey:@""];4. Add code to read or write to parse.com
    • Register/login usersShow LoginAndSignUpDemo
    • WritePFObject *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];
    • CountPFQuery *queryPhotoCount = [PFQuery queryWithClassName:@"Photo"];[queryPhotoCount whereKey:kPAPPhotoUserKey equalTo:[PFUsercurrentUser]];[queryPhotoCount setCachePolicy:kPFCachePolicyCacheThenNetwork];[queryPhotoCount countObjectsInBackgroundWithBlock:^(int number,NSError *error) {if (!error) {NSLog(@"count: %i",number);}}];
    • ReadPFQuery *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 constraintsBasic 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 photosPFObject *photo = [PFObject objectWithClassName:kPAPPhotoClassKey];[photo setObject:[PFUser currentUser] forKey:kPAPPhotoUserKey];[photo setObject:self.photoFile forKey:kPAPPhotoPictureKey];[photo setObject:self.thumbnailFile forKey:kPAPPhotoThumbnailKey];[photo save];
    • DEMOShow ArchUp demo
    • Demo: using JS APIhttp://jtubert.com/sketchit/
    • Server side methods(AKA: cloud code)Parse.Cloud.define("hello", function(request, response) {response.success("Hello Parse world!");});
    • Getting started: Cloud codeInstall the command line tool:curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bashCreate new project:$ parse new MyCloudCodeWrite functions:Parse.Cloud.define("hello", function(request, response) {response.success("Hello world!");});Deploy code:$ parse deployCall methods from app:[PFCloud callFunctionInBackground:@"hello" withParameters:@{} block:^(NSString *result, NSError*error) {if (!error) {// result is @"Hello world!"NSLog(@"%@",result);}}];
    • Questions/Comments
    • THANKS