Introduction to Parse
Abey
Mullassery
Internet & Mobile
    Developer
Why?
Why?

• Focus on the app
• Cheap enough
• Different skill set
• Export/Import
Why not
Why not

• Backend Computation
• Complex data model
• 3rd party services
iOS, Android & REST
Data
Data

• Powerful query
• Associations
• Big File
• Access Control
// Create a new Parse object
PFObject *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];
NSData *data = UIImageJPEGRepresentation(image, 0.60);
PFFile *file = [PFFile fileWithName:@"photo.jpg"
data:data];
[file saveInBackground];
Users
Users
• Sign up and Login
 Interface

• Facebook & Twitter
• Password reset
• Email verification
// Initialize the user object
PFUser *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.
    }
}];
Location
Location


• Built-in class
• Spatial search
PFGeoPoint *point = [PFGeoPoint geoPointWithLatitude:
40.0 longitude:-30.0];
[user setObject:point forKey:@"location"];
[user saveInBackground];
Push Notifications
Push Notifications

• Send from app
• Subscribe to Channels
• Send to Channels
// 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!"];
Questions?
Thank you

Introduction to Parse

  • 3.
  • 5.
  • 6.
  • 7.
    Why? • Focus onthe app • Cheap enough • Different skill set • Export/Import
  • 8.
  • 9.
    Why not • BackendComputation • Complex data model • 3rd party services
  • 11.
  • 12.
  • 13.
    Data • Powerful query •Associations • Big File • Access Control
  • 15.
    // Create anew Parse object PFObject *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];
  • 17.
    NSData *data =UIImageJPEGRepresentation(image, 0.60); PFFile *file = [PFFile fileWithName:@"photo.jpg" data:data]; [file saveInBackground];
  • 18.
  • 19.
    Users • Sign upand Login Interface • Facebook & Twitter • Password reset • Email verification
  • 21.
    // Initialize theuser object PFUser *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. } }];
  • 22.
  • 23.
  • 25.
    PFGeoPoint *point =[PFGeoPoint geoPointWithLatitude: 40.0 longitude:-30.0]; [user setObject:point forKey:@"location"]; [user saveInBackground];
  • 26.
  • 27.
    Push Notifications • Sendfrom app • Subscribe to Channels • Send to Channels
  • 29.
    // Subscribe toa push channel [PFPush subscribeToChannelInBackground:@"new_users"]; // Push to the channel from the client [PFPush sendPushMessageToChannelInBackground:@"new_users" withMessage:@"A new user signed up!"];
  • 31.
  • 33.