Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Leveraging parse.com
for Speedy Development
Andrew Kozlik
@codefortravel
www.justecho.com
What is Parse?
• Mobile Backend as a Service
• Purchased by Facebook in 2013
• Rapidly build applications
• Fantastic for ...
Parse Products
• Core
• Push
• Analytics
Parse Products - Core
• Core
• Data Storage
• Authentication
• Scheduled Tasks
• Custom API Endpoints
Parse Products - Push
• Push
• Broadcasting push notifications
• A/B testing
• Channel Segmenting
Parse Products - Analytics
• Analytics
• App Usage
• Event Tracking
• Crash Reporting
Pricing - Core
• 30 requests per second, 1 background job
• $100 every 10 requests per second
• 20GB File Storage
• $0.03 ...
Pricing - Push
• 1,000,000 unique push recipients
• $0.05 per 1000 recipients after
• $50 per million recipients
Pricing - Analytics
• Free!
• Gee, thanks.
Installation - iOS
• Download framework
• Add to project
• Add dependencies
• Initialize Parse in code
• Use the Quick Sta...
Installation - Android
• Download SDK
• Add SDK to build.gradle
• Update Manifest
• Initialize Parse in application’s onCr...
Core
• Schemaless
• Object Creation
• Object Retrieval
• Relational Data
• Local Data Store
• Special Objects
Schemaless
• Properties automatically added to backend
• Never have to look at backend
• No backend code is written to sav...
Creating Objects
• Create a new parse object with a specific class
name. Classes are similar to tables.
• Set all appropri...
iOS Code
PFObject *presentation = [PFObject objectWithClassName:@“Presentation”];
presentation.title = @“Leveraging Parse ...
Android Code
ParseObject presentation = new ParseObject(“Presentation”)
presentation.put(“title”, “Leveraging Parse for Sp...
Retrieving Objects
• Parse uses Queries to retrieve objects
• Instantiate a new query for a class
• Set any conditions
• R...
iOS Code
PFQuery *query = [PFQuery queryWithClassName:@“Presentation”];
[query whereKey:@“author” equalTo:@“Andrew”];
[que...
Android Code
ParseQuery<ParseObject> query =
ParseQuery.getQuery(“Presentation”);
query.whereEqualTo(“author”, “Andrew”);
...
Local Data Store
• Save data locally to the device
• Excellent for saving data for later processing
• Leverages SQLite
• O...
Relational Data
• One to Many Relationships
• Set one object’s key to the other object
• Object ID is stored in DB
• Multi...
iOS Code
PFUser *user = [PFUser currentUser];
PFRelation *relation = [user relationForKey:@“likes”];
[relation addObject:p...
Android Code
ParseUser user = ParseUser.getCurrentUser();
ParseRelation<ParseObject> relation =
user.getRelation(“likes”);...
Special User Object
• Registration
• Authentication
• Anonymous Users
• ACL
Registration / Authentication
• Required username and password on creation
• Email and other profile fields are optional
•...
Anonymous Users
• Track a user without having them register
• Convert anonymous users to registered users
• Great for allo...
Access Control Lists
• Users can be granted privileges to objects
• Read, Write, and Delete privileges can be set
• ACL ca...
iOS Code
PFUser *user = [PFUser user];
user.username = @“akozlik”;
user.password = @“secret_password”;
user.email = @“andr...
Android Code
ParseUser user = new ParseUser();
user.setUsername(“akozlik”);
user.setPassword(“secret_password”);
user.setE...
Push
• Setup
• Installations
• Channels
• Advanced Targeting
Setup
• Set up your application to receive notifications
• iOS
• Upload certificates to Parse servers
• Update application...
Installations
• Each installation of your app is saved to Parse
• Used to target a specific device
• Use installations in ...
Channels
• Users can be subscribed to channels
• Considered to be a grouping of installations
• Use for specific group bas...
Advanced Targeting
• Query for specific users
• Save keys to an installation object
• Query that installation object subse...
Analytics
• Track app opens
• Custom analytics, similar to Google Analytics
• Track event with a dictionary or map of
dime...
Other Goodies
• Cloud Code
• Uses Javascript API
• Complex queries and endpoints
• Background Jobs
• Scheduled tasks for p...
Other Goodies
• Boilerplate UI
• Authentication
• Registration
• Table Views / List Views
• In App Purchases
• Add handler...
Get Building!
• parse.com
• @codefortravel
• www.justecho.com
Upcoming SlideShare
Loading in …5
×

Leveraging parse.com for Speedy Development

365 views

Published on

After viewing this presentation you will have a high level overview of Parse's services and understand how quick and easy it is to store and retrieve your data in the cloud. Stop wasting time building out a backend and get your MVP out the door!

This presentation was given to the combined Orlando iOS and Central Florida Android Developers Meetup on April 22, 2015.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Leveraging parse.com for Speedy Development

  1. 1. Leveraging parse.com for Speedy Development Andrew Kozlik @codefortravel www.justecho.com
  2. 2. What is Parse? • Mobile Backend as a Service • Purchased by Facebook in 2013 • Rapidly build applications • Fantastic for prototyping
  3. 3. Parse Products • Core • Push • Analytics
  4. 4. Parse Products - Core • Core • Data Storage • Authentication • Scheduled Tasks • Custom API Endpoints
  5. 5. Parse Products - Push • Push • Broadcasting push notifications • A/B testing • Channel Segmenting
  6. 6. Parse Products - Analytics • Analytics • App Usage • Event Tracking • Crash Reporting
  7. 7. Pricing - Core • 30 requests per second, 1 background job • $100 every 10 requests per second • 20GB File Storage • $0.03 per GB extra • 20GB DB Storage • $200 per GB extra • 2TB File Transfer • $0.10 per GB extra
  8. 8. Pricing - Push • 1,000,000 unique push recipients • $0.05 per 1000 recipients after • $50 per million recipients
  9. 9. Pricing - Analytics • Free! • Gee, thanks.
  10. 10. Installation - iOS • Download framework • Add to project • Add dependencies • Initialize Parse in code • Use the Quick Start guide!
  11. 11. Installation - Android • Download SDK • Add SDK to build.gradle • Update Manifest • Initialize Parse in application’s onCreate() • Use the Quick Start guide!
  12. 12. Core • Schemaless • Object Creation • Object Retrieval • Relational Data • Local Data Store • Special Objects
  13. 13. Schemaless • Properties automatically added to backend • Never have to look at backend • No backend code is written to save or retrieve objects
  14. 14. Creating Objects • Create a new parse object with a specific class name. Classes are similar to tables. • Set all appropriate keys and values. • Save your object in background (or foreground if you really want to)
  15. 15. iOS Code PFObject *presentation = [PFObject objectWithClassName:@“Presentation”]; presentation.title = @“Leveraging Parse for Speedy Development”; presentation.author = @“Andrew”; [presentation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (succeeded) { NSLog(@“Woo hoo!”); } }];
  16. 16. Android Code ParseObject presentation = new ParseObject(“Presentation”) presentation.put(“title”, “Leveraging Parse for Speedy Development”); presentation.put(“author”,“Andrew”); presentation.saveInBackground();
  17. 17. Retrieving Objects • Parse uses Queries to retrieve objects • Instantiate a new query for a class • Set any conditions • Retrieve on background thread
  18. 18. iOS Code PFQuery *query = [PFQuery queryWithClassName:@“Presentation”]; [query whereKey:@“author” equalTo:@“Andrew”]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { for (PFObject *object in objects) { NSLog(@“%@“, object[@“title”]); } }];
  19. 19. Android Code ParseQuery<ParseObject> query = ParseQuery.getQuery(“Presentation”); query.whereEqualTo(“author”, “Andrew”); query.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> presentationList, ParseException e) { for (int i =0; i < presentationList.size(); i++) { ParseObject object = presentationList.get(i); System.out.println(object.get(“title”)); } } });
  20. 20. Local Data Store • Save data locally to the device • Excellent for saving data for later processing • Leverages SQLite • Objects are “pinned” to background • Querying works just like network calls, just indicate you’re querying local store
  21. 21. Relational Data • One to Many Relationships • Set one object’s key to the other object • Object ID is stored in DB • Multiple objects can be stored as an array • Many to Many Relationships • Use the relation object • Does not retrieve all objects in the relationship • Scalable • Relationships can be queried as Parse Objects
  22. 22. iOS Code PFUser *user = [PFUser currentUser]; PFRelation *relation = [user relationForKey:@“likes”]; [relation addObject:presentation]; [user saveInBackground];
  23. 23. Android Code ParseUser user = ParseUser.getCurrentUser(); ParseRelation<ParseObject> relation = user.getRelation(“likes”); relation.add(presentation); user.saveInBackground();
  24. 24. Special User Object • Registration • Authentication • Anonymous Users • ACL
  25. 25. Registration / Authentication • Required username and password on creation • Email and other profile fields are optional • Signup and Login methods are available • Optional e-mail verification
  26. 26. Anonymous Users • Track a user without having them register • Convert anonymous users to registered users • Great for allowing access to your app
  27. 27. Access Control Lists • Users can be granted privileges to objects • Read, Write, and Delete privileges can be set • ACL can be defaulted for all users
  28. 28. iOS Code PFUser *user = [PFUser user]; user.username = @“akozlik”; user.password = @“secret_password”; user.email = @“andrew@justecho.com”; [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (!error) { } else { NSLog(@“%@“, [error userInfo][@“error”]; } }];
  29. 29. Android Code ParseUser user = new ParseUser(); user.setUsername(“akozlik”); user.setPassword(“secret_password”); user.setEmail(“andrew@justecho.com”); user.signUpInBackground(new SignUpCallback() { public void done (ParseException e) { if (e == null ) { } else { } } });
  30. 30. Push • Setup • Installations • Channels • Advanced Targeting
  31. 31. Setup • Set up your application to receive notifications • iOS • Upload certificates to Parse servers • Update application to register for push • Android • Update app permissions • Register application for push service • Parse guides are your friend
  32. 32. Installations • Each installation of your app is saved to Parse • Used to target a specific device • Use installations in conjunction with channels • Unique per installation, not device • Uninstalling and reinstalling generates new installation ID
  33. 33. Channels • Users can be subscribed to channels • Considered to be a grouping of installations • Use for specific group based messaging or marketing • Pushes can be sent directly from an app • Great for notifying users of related information
  34. 34. Advanced Targeting • Query for specific users • Save keys to an installation object • Query that installation object subset • Save Users to installation objects!!!
  35. 35. Analytics • Track app opens • Custom analytics, similar to Google Analytics • Track event with a dictionary or map of dimensions • View open rates, installation rates, crashes, etc.
  36. 36. Other Goodies • Cloud Code • Uses Javascript API • Complex queries and endpoints • Background Jobs • Scheduled tasks for processing data • Work similar to cron tasks • Uses Javascript API
  37. 37. Other Goodies • Boilerplate UI • Authentication • Registration • Table Views / List Views • In App Purchases • Add handlers to monitor when objects are purchased • Purchase object through Parse classes • Store downloadable purchases as Parse files
  38. 38. Get Building! • parse.com • @codefortravel • www.justecho.com

×