Introduction to Parse

2,505 views

Published on

An overview of the mobile backend service Parse with sample code snippets.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,505
On SlideShare
0
From Embeds
0
Number of Embeds
304
Actions
Shares
0
Downloads
27
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Introduction to Parse

    1. 1. Introduction to Parse
    2. 2. AbeyMullasseryInternet & Mobile Developer
    3. 3. Why?
    4. 4. Why?• Focus on the app• Cheap enough• Different skill set• Export/Import
    5. 5. Why not
    6. 6. Why not• Backend Computation• Complex data model• 3rd party services
    7. 7. iOS, Android & REST
    8. 8. Data
    9. 9. Data• Powerful query• Associations• Big File• Access Control
    10. 10. // Create a new Parse objectPFObject *post = [PFObject objectWithClassName:@"Post"];[post setObject:@"Hello World" forKey:@"title"];[post setObject:user forKey:@"author"];// Save it to Parse[post saveEventually];[user setObject incrementKey:@"posts"];[user saveEventually];PFQuery *query = [PFQuery queryWithClassName:@"Posts"];[query whereKey:@"author_name" equalTo:@"Abey Mullassery"];NSArray* posts = [query findObjects];
    11. 11. NSData *data = UIImageJPEGRepresentation(image, 0.60);PFFile *file = [PFFile fileWithName:@"photo.jpg"data:data];[file saveInBackground];
    12. 12. Users
    13. 13. Users• Sign up and Login Interface• Facebook & Twitter• Password reset• Email verification
    14. 14. // Initialize the user objectPFUser *user = [PFUser user];user.username = @"abey";user.password = @"N0th1ngM@tters";[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError*error) { if (!error) { // Hooray! Let them use the app now. } else { NSString *errorString = [[error userInfo]objectForKey:@"error"]; // Show the error and let the user try again. }}];
    15. 15. Location
    16. 16. Location• Built-in class• Spatial search
    17. 17. PFGeoPoint *point = [PFGeoPoint geoPointWithLatitude:40.0 longitude:-30.0];[user setObject:point forKey:@"location"];[user saveInBackground];
    18. 18. Push Notifications
    19. 19. Push Notifications• Send from app• Subscribe to Channels• Send to Channels
    20. 20. // Subscribe to a push channel[PFPush subscribeToChannelInBackground:@"new_users"];// Push to the channel from the client[PFPush sendPushMessageToChannelInBackground:@"new_users"withMessage:@"A new user signed up!"];
    21. 21. Questions?
    22. 22. Thank you

    ×