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
7. Objects
PFObject *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
9. User Management
PFUser *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. [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. PFLogInViewController
• Built in view controller to signup or login
users.
• Can be stylized and configured
PFLogInViewController *logInController = [[PFLogInViewController
alloc] init];
logInController.delegate = self;
logInController.signUpController.delegate = self;
logInController.fields = PFLogInFieldsUsernameAndPassword |
PFLogInFieldsLogInButton | PFLogInFieldsTwitter |
PFLogInFieldsSignUpButton | PFSignUpFieldsSignUpButton;
[self presentModalViewController:logInController animated:YES];
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.
14. Misc
• ACLs for security
• Visit Parse.com for tons of tutorials and videos
• You’ll be up and running in < 2 mins
17. 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
18. 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)
19. 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.
20. BUY MY APPS :)
http://www.stevensonsoftware.com