Looking for the Best Back-end for your App ? Parse is the answer

  • View
    219

  • Download
    0

  • Category

    Mobile

Preview:

Citation preview

What's Parse?

Parse is a cloud-based data management system that allows you to quickly develop web and mobile apps.

It makes developing apps really easy by taking the back-end out of your hands.

Table

The reason it's called a class is because you'll generally create objects from a certain class and then save that object to the database.

Class

Types of classes

User classes store user-specific information

Installation classes are typically used to send push notifications for mobile apps.

Role classes This is called ACL (access control list) within Parse.

Product classes store in-app product data.

Custom classes are for anything else.

cloud codes

Implementing features like push notification background jobs etc.

Mobile App Development

Perform crud operations on user class without session token

LOGIN API

curl -X POST \ -H "X-Parse-Application-Id: QcrHa6srwyHhhu6l7QQg5eorQFYfixsZIPRHOEya" \ -H "X-Parse-REST-API-Key: nKpuSPGfizMdWW8r6hQc1JzkgtFRvmXcs2MQ62my" \ -H "X-Parse-Revocable-Session: 1" \ -H "Content-Type: application/json" \ -d '{"username":"cooldude6","password":"p_n7!-e8","phone":"415-392-0202"}' \ https://api.parse.com/1/users

Response

{ "createdAt": "2011-11-07T20:58:34.448Z", "objectId": "g7y9tkhB7O", "sessionToken": "r:pnktnjyb996sj4p156gjtp4im"

}

The sessionToken which can be used to authenticate subsequent requests as this user

Sample cloud function

// Use Parse.Cloud.define to define as many cloud functions as you want.

// For example:

Parse.Cloud.define("hello", function(request, response) {

response.success("Hello world!");

});

push notification

Push notifications let your application notify a user of new messages or events even when the user is not actively using your application

Background Jobs

Background jobs are non-interactive processes that run behind the normal interactive operations.

Parse.Cloud.job("userMigration", function(request, status) { // Set up to modify user data Parse.Cloud.useMasterKey(); // Query for all users var query = new Parse.Query(Parse.User); query.each(function(user) { // Set and save the change user.set("plan", request.params.plan); return user.save(); }).then(function() { // Set the job's success status status.success("Migration completed successfully."); }, function(error) { // Set the job's error status status.error("Uh oh, something went wrong."); });});

WebHook

Webhook is a service which is using to process or call some events when something happens.

It is like a simple HTTP call back which is process HTTP POST method when something happens before/after in database.

Limitations of parse webhook

1.In parse webhooks are limited to 30 seconds after that parse will be automatically terminate.

2.Only POST methods Request handled.

3.It require HTTPS connection and valid SSL certificate.

Thanks