Parse - a mobile backend platform

1,597
-1

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
1,597
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Parse - a mobile backend platform

  1. 1. Parse A mobile backend platform www.parse.com Carlotta Tatti Twitter: @thestubborndev Email: carlotta.tatti@gmail.com
  2. 2. Cosa offre Parse? • Una soluzione integrata per la creazione di backend • SDK per Android, iOS, Javascript, Unity 3D, Windows 8, Windows Phone • Endpoint REST
  3. 3. Parse Data
  4. 4. Inizializzazione dell’SDK [Parse setApplicationId:@"APPLICATION_ID" clientKey:@"CLIENT_KEY"]; Creazione di un elemento ParseObject gameScore = new ParseObject("GameScore"); gameScore.put("score", 1337); gameScore.put("playerName", "Sean Plott"); gameScore.put("cheatMode", false); gameScore.saveInBackground();
  5. 5. Creazione di un utente ParseUser user = new ParseUser(); user.setUsername("my name"); user.setPassword("my pass"); user.setEmail("email@example.com");   // other fields can be set just like with ParseObject user.put("phone", "650-253-0000");   user.signUpInBackground(new SignUpCallback() {   public void done(ParseException e) {     if (e == null) {       // Hooray! Let them use the app now.     } else {       // Sign up didn't succeed. Look at the ParseException       // to figure out what went wrong     }   } });
  6. 6. Query ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore"); query.whereEqualTo("playerName", "Dan Stemkoski"); query.findInBackground(new FindCallback<ParseObject>() {     public void done(List<ParseObject> scoreList, ParseException e) {         if (e == null) {             Log.d("score", "Retrieved " + scoreList.size() + " scores");         } else {             Log.d("score", "Error: " + e.getMessage());         }     } });
  7. 7. Parse Push
  8. 8. Push Notifications • Dashboard web per spedire Push Notification • Targeting dei destinatari • Pianificazione oraria
  9. 9. Send a Push Notification Esempio 1 ParsePush push = new ParsePush(); push.setChannel("Giants"); push.setMessage("The Giants just scored! It's now 2-2 against the Mets."); push.sendInBackground(); Esempio 2 // Create our Installation query ParseQuery pushQuery = ParseInstallation.getQuery(); pushQuery.whereEqualTo("injuryReports", true);   // Send push notification to query ParsePush push = new ParsePush(); push.setQuery(pushQuery); // Set our Installation query push.setMessage("Willie Hayes injured by own pop fly."); push.sendInBackground();
  10. 10. Parse Social
  11. 11. Parse Social • Signup tradizionale (username e password) • Signup tramite Twitter o Facebook • Gestione di tutto ciò che riguarda l’autenticazione e la gestione degli utenti (login, logout, password reset, email di conferma etc..)
  12. 12. Login with Facebook 1. 2. ParseFacebookUtils.initialize("YOUR FACEBOOK APP ID"); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {   super.onActivityResult(requestCode, resultCode, data);   ParseFacebookUtils.finishAuthentication(requestCode, resultCode, data); } continua...
  13. 13. Login with Facebook 3. ParseFacebookUtils.logIn(this, new LogInCallback() {   @Override   public void done(ParseUser user, ParseException err) {     if (user == null) {       Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");     } else if (user.isNew()) {       Log.d("MyApp", "User signed up and logged in through Facebook!");     } else {       Log.d("MyApp", "User logged in through Facebook!");     }   } });
  14. 14. Login with Facebook L’utente corrente è sempre accessibile: ParseUser currentUser = ParseUser.getCurrentUser(); if (currentUser != null) {   // do stuff with the user } else {   // show the signup or login screen }
  15. 15. Cloud Code
  16. 16. Cloud Code • Codice server-side in Javascript • Estensibile tramite moduli • Possibilità di pianificare task periodici
  17. 17. Una funzione Cloud Code Javascript Parse.Cloud.define("hello", function(request, response) {   response.success("Hello world!"); }); Android ParseCloud.callFunctionInBackground("hello", new HashMap<String, Object>(), new FunctionCallback<String>() {   void done(String result, ParseException e) {     if (e == null) {       // result is "Hello world!"     }   } });
  18. 18. Pricing

×