Parse.com

7,610 views

Published on

Presentation I did at Salt Lake Cocoaheads on Parse.com, a simple "database in the cloud" service for mobile and webapps.

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

No Downloads
Views
Total views
7,610
On SlideShare
0
From Embeds
0
Number of Embeds
648
Actions
Shares
0
Downloads
0
Comments
0
Likes
9
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
  • Parse.com

    1. 1. Parse.com Quickie @dnstevenson http://www.stevensonsoftware.com
    2. 2. What is Parse.com?
    3. 3. What is Parse.com?• What iCloud should be
    4. 4. What is Parse.com?• Backend for apps and websites • Store key/value data (think NoSQL in the cloud) • Store Files• Awesome API for iOS (and Android and REST) • blocks or callbacks• FREE for most of us
    5. 5. Extras• User management • Account creation w/ optional email verification • Logins with username/password, Facebook & Twitter• Easy Push Notifications• Location “stuff”
    6. 6. Parse.com
    7. 7. ObjectsPFObject *gameScore = [PFObject objectWithClassName:@"GameScore"];[gameScore setObject:[NSNumber numberWithInt:1337] forKey:@"score"];[gameScore setObject:@"Sean Plott" forKey:@"playerName"];[gameScore setObject:[NSNumber numberWithBool:NO] forKey:@"cheatMode"];[gameScore saveEventually]; This is really cool - it will upload to server if network access, or it’ll save it to disk and upload later when on-network
    8. 8. Retrieving ObjectsPFQuery *query = [PFQuery queryWithClassName:@"GameScore"];[query whereKey:@"playerName" equalTo:@"Dan Stemkoski"];[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { // The find succeeded. NSLog(@"Successfully retrieved %d scores.", objects.count); } else { // Log details of the failure NSLog(@"Error: %@ %@", error, [error userInfo]); }}];
    9. 9. User ManagementPFUser *user = [PFUser user];user.username = @"my name";user.password = @"my pass";user.email = @"email@example.com";[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (!error) { // Hooray! Let them use the app now. } else { NSString *errorString = [[error userInfo] objectForKey:@"error"]; // Show the errorString somewhere and let the user try again. }}];
    10. 10. [PFUser logInWithUsernameInBackground:@"myname" password:@"mypass" block:^(PFUser *user, NSError *error) { if (user) { // Do stuff after successful login. } else { // The login failed. Check error to see why. } }];[PFFacebookUtils logInWithPermissions:permissions block:^(PFUser *user, NSError *error) { if (!user) { NSLog(@"Uh oh. The user cancelled the Facebook login."); } else if (user.isNew) { NSLog(@"User signed up and logged in through Facebook!"); } else { NSLog(@"User logged in through Facebook!"); }}];
    11. 11. PFLogInViewController • Built in view controller to signup or login users. • Can be stylized and configuredPFLogInViewController *logInController = [[PFLogInViewControlleralloc] init];logInController.delegate = self;logInController.signUpController.delegate = self;logInController.fields = PFLogInFieldsUsernameAndPassword |PFLogInFieldsLogInButton | PFLogInFieldsTwitter |PFLogInFieldsSignUpButton | PFSignUpFieldsSignUpButton;[self presentModalViewController:logInController animated:YES];
    12. 12. Push Notifications[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeAlert| UIRemoteNotificationTypeSound];- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken{ Awesome - segregate your // Tell Parse about the device token. [PFPush storeDeviceToken:newDeviceToken]; push notifications // Subscribe to the global broadcast channel. into channels [PFPush subscribeToChannelInBackground:@"BYU-Football"];}
    13. 13. Misc• ACLs for security• Visit Parse.com for tons of tutorials and videos • You’ll be up and running in < 2 mins
    14. 14. How Much?
    15. 15. DEMO
    16. 16. Uses• Super fast way to add a backend data and file storage to your apps• Easy to way to share data between iOS and Android apps (anything!)• Easy to keep in-app-purchase records, other statistical data• Push Notifications
    17. 17. Worried?• Export your data anytime• They are venture backed (Y Combinator and dozens of others)• They had a good beta period and are now charging (good sign: they’re trying to make money)
    18. 18. Final Word(s)• Visit parse.com and try it, and then let us know what use-cases you’ve found it useful for• They’re active on twitter and email. I asked for a feature in the API and they added it a couple of weeks later.
    19. 19. BUY MY APPS :)http://www.stevensonsoftware.com

    ×