What’s ParseTsutomu Ogasawara
https://www.parse.com/
What’s Parse?•   BaaS for iOS / Android•   Quick Start / Minimum Configuration•   Full Stack SDK•   Rest API / JavaScript ...
Code ExamplesObjective-C for iOSPFObject*post = [PFObjectobjectWithClassName:@"Post"];[post setObject:@"Hello World"forKey...
Structure                             Data StorageUser Authentication                                                     ...
Functions•   Data Storage / File Storage•   Push Notification Gateway•   User Management•   Geo Location Support•   Facebo...
Data Storage / File Storage• SQL-like simple Database (PFObject)   – Schemaless row-column model   – Working in the backgr...
Save a photoPFObject *photo = [PFObjectobjectWithClassName:@"Photo"];PFUser *currentUser = [PFUsercurrentUser];[photo setO...
Push Notification (PFPush)• Cross platform  – iOS -> Android / Android ->iOS  – Broadcast to both OS apps.• Send from  – A...
Subscribe push notification channelPFUser *user = [PFUsercurrentUser];NSString *channel = [NSStringstringWithFormat:@"user...
User Management (PFUser)• Original Signup and Login  – Email address verification  – Resetting Password  – User Interfaces...
Geo Location (PFGeoPoint)• Store a geo location data in PFObject• Query objects  – ordered by distance.  – within miles / ...
Facebook& Twitter• Authentication• Libralies  – PF_Facebook which is the wrapper of    FacebookiOS SDK  – PF_Twitter which...
Facebook login- (IBAction)pressLoginButton:(id)sender {NSArray *permissions = [[NSArrayalloc] initWithObjects:            ...
Twitter API call with authentication// generate request objectNSURL *url = [NSURLURLWithString:@"https://api.twitter.com/1...
Thanks!
Upcoming SlideShare
Loading in...5
×

What's Parse

1,599

Published on

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

No Downloads
Views
Total Views
1,599
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
67
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

What's Parse

  1. 1. What’s ParseTsutomu Ogasawara
  2. 2. https://www.parse.com/
  3. 3. What’s Parse?• BaaS for iOS / Android• Quick Start / Minimum Configuration• Full Stack SDK• Rest API / JavaScript SDK• Useful Documentations / Tutorials• Freemium
  4. 4. Code ExamplesObjective-C for iOSPFObject*post = [PFObjectobjectWithClassName:@"Post"];[post setObject:@"Hello World"forKey:@"title"];[post setObject:@"I got Parse working on iOS!"forKey:@"content"];[post saveInBackground];Java for AndroidParseObjectpost = new ParseObject("Post");post.put("title", "Hello World");post.put("content", "I got Parse working on Android!");post.saveInBackground();JavaScriptvarPost = Parse.Object.extend("Post");varpost = new Post();post.set("title", "Hello World");post.set("content", "I got Parse working on Android!");post.save(null, { success: function() {}, error: function() {} );
  5. 5. Structure Data StorageUser Authentication Push Notification Rest API iOS SDK JavaScript SDK Android SDK JavaScript SDK
  6. 6. Functions• Data Storage / File Storage• Push Notification Gateway• User Management• Geo Location Support• Facebook& Twitter
  7. 7. Data Storage / File Storage• SQL-like simple Database (PFObject) – Schemaless row-column model – Working in the background – Spreadsheet-like Data browser on parse.com – Many ways to retrieve data• File store (PFFile) – File storage up to 10MB per file. – Working in the background and get the progress. – Examples.
  8. 8. Save a photoPFObject *photo = [PFObjectobjectWithClassName:@"Photo"];PFUser *currentUser = [PFUsercurrentUser];[photo setObject:currentUserforKey:@"user"];[photo setObject:photoIDforKey:@"photo_id"];[photo saveInBackgroundWithBlock:^(BOOLsucceeded, NSError *error) {if( succeeded ) { } else { }}];Retrieve photosPFQuery *query = [PFQueryqueryWithClassName:@"Photo"];[query orderByDescending:@"updatedAt"];[query findObjectsInBackgroundWithBlock: ^(NSArray *objects, NSError *error) {if( ! error ) { } else { }}];
  9. 9. Push Notification (PFPush)• Cross platform – iOS -> Android / Android ->iOS – Broadcast to both OS apps.• Send from – Apps – REST API – Web console on parse.com
  10. 10. Subscribe push notification channelPFUser *user = [PFUsercurrentUser];NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId];[PFPushsubscribeToChannelInBackground:channelblock: ^(BOOLsucceeded, NSError *error) { ...}];Send a notificationPFUser *user = [photoObjectobjectForKey:@"user"];NSString *channel = [NSStringstringWithFormat:@"user_%@", user.objectId];NSString *commenter = [currentUservalueForKeyPath:@"twitter_userdata.screen_name"];NSString *alert = [NSStringstringWithFormat:@"%@ さんがコメントしました。", commenter];NSDictionary *data = [NSDictionarydictionaryWithObjectsAndKeys:commentObject.objectId, @"comment",photoObject.objectId, @"photo", alert, @"alert",@"default", @"sound",nil];[PFPushsendPushDataToChannelInBackground:channelwithData:data];
  11. 11. User Management (PFUser)• Original Signup and Login – Email address verification – Resetting Password – User Interfaces• Login with Facebook& Twitter• Security – Access Control List (PFACL) – Role-based Access Control (PFRole)
  12. 12. Geo Location (PFGeoPoint)• Store a geo location data in PFObject• Query objects – ordered by distance. – within miles / km / radians – within rectangle from south-west to north-east• Examples
  13. 13. Facebook& Twitter• Authentication• Libralies – PF_Facebook which is the wrapper of FacebookiOS SDK – PF_Twitter which calls Twitter REST API
  14. 14. Facebook login- (IBAction)pressLoginButton:(id)sender {NSArray *permissions = [[NSArrayalloc] initWithObjects: @"user_likes", @"read_stream”, nil]; // Switch Facebook app or open facebook login page in Safari [PFFacebookUtilslogInWithPermissions:permissions block: ^(PFUser *user, NSError *error) {if( user && ! error ) { // logged in with Facebook} }];}Twitter login- (IBAction)pressLoginButton:(id)sender {// Call Twitter login dialog [PFTwitterUtilslogInWithBlock:^(PFUser *user, NSError *error) {if( user && ! error ) { // logged in with Twitter} }];}
  15. 15. Twitter API call with authentication// generate request objectNSURL *url = [NSURLURLWithString:@"https://api.twitter.com/1/account/verify_credentials.json"];NSMutableURLRequest *request = [NSMutableURLRequestrequestWithURL:url];// sign the request with auth userPF_Twitter *twitter = [PFTwitterUtilstwitter];[twitter signRequest:request];// send requestNSURLResponse *response = nil;NSError *error = nil;NSData *data = [NSURLConnectionsendSynchronousRequest:requestreturningResponse:&responseerror:&error];if( data ) {// save user infoNSDictionary *jsonObjects = [NSJSONSerializationJSONObjectWithData:dataoptions:NSJSONReadingMutableContainerserror:&error];}
  16. 16. Thanks!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×