Five New Products, Live From F8

F8 Roundup

Today we’re incredibly excited to share five new product announcements with you plus an update to our SDKs, live from the F8 Developer Conference at Fort Mason in San Francisco.

Since F8 2014, our community of developers has grown to include over 400,000 of you from around the world, moving fast and shipping great experiences on Parse every single day. This community is powering more than 500 million active app installations in the last month alone.We’re always looking for ways to help you build, scale, and secure the most successful app experiences possible.

Introducing the latest and greatest updates to the Parse platform:

Better Security with the New Enhanced Sessions
Giving you more control than ever over your app’s security, the new Enhanced Sessions feature allows you to manage session logins for each device that your users log in with. Read more

Parse for Web, Parse for Mobile, and now Parse for Internet of Things
Starting today, it is easier than ever to use Parse to build apps for devices like garage door openers, smart batteries, thermostats, security cameras, and much more. Using our new SDK for the Arduino Yún and our Embedded C SDK for Linux and Real Time Operating Systems (RTOS), you can now use the power of Parse to more easily connect apps to hardware devices. Check out the new SDKs

Let’s Build Together — with Parse + React
Meet our new Parse + React library, making it incredibly easy and seamless for you to access and store Parse data from React applications. Build complex and dynamic apps like never before. Access these tools now

Endless Possibilities, No Matter Which Server You Love
With the new Cloud Code Webhooks, you now have the freedom to write code in whatever language or framework you want. As long as you have a server running it, your Cloud Code can integrate with it. Get started here

Chart New Territory with Parse Explorer
Try our brand-new, powerful debugging tool for production issues in your Parse app. Investigate what’s happening with a subset of your app’s API requests with our powerful yet easy-to-use query language. Find out more

Supporting Facebook SDK v4
Prior to today, integrating the Facebook SDK with our Parse iOS and Android SDKs has been a seamless process. With the new release of Facebook SDK v4, we’re excited to continue to offer the same level of support for the new v4 SDK from day one—while continuing to support the v3 SDK. Download the new SDKs here

We hope you enjoy exploring these new releases. Tune in to the livestream today and tomorrow to catch five in-depth Parse sessions, in addition to exclusive online content from F8. Happy building!

Nancy Xiao
March 25, 2015

Parse and React, a Shared Chemistry

Parse + React

As a web engineer, I love React. I’ve been using it since it was an experimental technology within Facebook, and each new version has helped make complex app development simpler. A few months ago, I started exploring how to best bring our Parse tools into the React ecosystem, in a way that feels like a natural extension of React. And today at F8, we’re excited to launch these tools for Parse and React developers. Our Parse+React library makes it easy to read and write Parse data from React, and gives React developers a way to effortlessly add remote storage to their applications.

Parse+React, available now on Github and npm, gives components the ability to subscribe to Parse queries, and allows them to update Parse data while still preserving React’s single direction of data flow. To give a component access to a Parse query, you simply have to subscribe to it from the component. Data requirements are co-located with the component itself — that way, there’s no need to worry about fetching data when a component renders, or routing the data through the component tree to its destination. Consider this component, designed to render a list of comments:

// Render a list of comments passed into the 'comments' prop
var CommentBlock = React.createClass({
  render: function() {
    return <ul>
      {this.props.comments.map(function(c) {
        return <li>{c.text}</li>
      })}
    </ul>;
  }
});

It requires fetching the comments somewhere else, and ensuring that they get passed into this component when it renders. With Parse+React, adding data from a Parse Query is this simple:

// Render a list of comments from the Parse API
var CommentBlock = React.createClass({
  mixins: [ParseReact.Mixin],

  observe: function() {
    return {
      comments: (new Parse.Query("Comment")).descending("createdAt")
    };
  },
  
  render: function() {
    return <ul>
      {this.data.comments.map(function(c) {
        return <li>{c.text}</li>
      })}
    </ul>;
  }
});

This component includes the Parse+React Mixin, which lets it subscribe to Parse Queries. The observe() method declares subscriptions to different queries, and makes the results available on this.data.

When it comes to modifying data, Parse+React takes a functional approach to maintain a single direction of data flow. This helps applications scale easily, preventing deadlocks or synchronization issues when many components share data.

// Create a new Comment object
ParseReact.Mutation.Create("Comment", { text: "Parse and React work well together" })
  .dispatch();

A mutation is applied to an object and dispatched, and the result will be immediately available to components with subscriptions. So, if we created a new Comment object, it would be added to the result set of the CommentBlock above. This lets you build snappy interfaces that immediately respond to user input.

With these two tools — query subscription and object updates — you’ll be able to build React applications that easily include data persistence. I’m thrilled to be bringing the power of Parse to React developers, and this is just the beginning. We’ll continue to work closely with the React team to ensure that our tools take advantage of the latest features. In fact, when React Native becomes available to the public, you’ll be able to use Parse with it from day one! The field of app development is changing, and we’re here to help you at each stage.

Andrew Imm
March 25, 2015

Connecting Hardware with the Cloud: Parse for IoT

Parse for IoT

At Parse, our passion is making developer experiences easier on any platform—including platforms that extend beyond mobile. Of these platforms, one of the most exciting new spaces is the Internet of Things. We believe that connecting more hardware devices with the cloud has the potential to change the world for the better. We are already seeing devices that add tremendous value to people’s lives, from wearables that help you sleep better to insulin trackers that aid people living with diabetes.

But, as with mobile, connecting these devices to the cloud can be difficult. In addition to maintaining a backend, developers must contend with notoriously constrained environments on the client. We’ve been listening to feedback from a wide range of Parse customers who are already using our platform in hardware products — like Chamberlain, who makes a line of smart garage door openers that interact with our REST API; Milestone Sports, who make the wearable running tracker Milestone Pod; and Roost, who make smart batteries for smoke detectors. From these conversations, we decided we could go one step further.

Today, we’re proud to announce Parse for IoT: an official new line of SDKs for connected devices.

The first is an Arduino SDK targeted for the Arduino Yún, a microcontroller board with built-in WiFi capabilities. The SDK interface is in Wiring, and, in the spirit of Arduino, we designed it to be as simple as possible. For example, all it takes is a few lines of code to save temperature data from a smart thermostat:

ParseCreateObject create;
create.setClassName('TemperatureReading');
create.add('currentTemperature', 175.0);
create.send();

From there, the data will be available in your Parse app ready to be retrieved by your mobile app, another device, or simply logged for analytics purposes. Beyond the Yún, we’re already working on SDKs for upcoming platforms such as the Arduino Zero with the WiFi 101 shield.

In addition, we’re releasing an Embedded C SDK, targeted for Linux and Real Time Operating Systems (RTOS). These open source SDKs serve as reference implementations that are being used by leading chipset manufacturers to provide support for their hardware platforms. If you are a chipset manufacturer interested in working with us, please reach out at iotpartners@fb.com.

The C SDK provides a simple interface for our REST API. For example, to save the same temperature data you would do:

char data[] = '{ \'currentTemperature\': 175.0 }';
parseSendRequest(client, 'POST', '/1/classes/TemperatureReading', data, NULL);

You’ll be able to find these SDKs on GitHub, as well as a full set of Quick Starts and Guides on Parse. With these SDKs, your device will be able to receive push notifications, save data, and take advantage of the Parse Cloud. It’s easy to get started from scratch, and the process should be very familiar for developers who already use Parse. Check out the Quick Start guide and start adding Parse to your hardware device in minutes.

The possibilities are endless. You could make a smart thermostat that can be controlled via a mobile app, or a security camera that saves images every minute, or even a music device that can be controlled via a web app. We’re so excited to see what you build.

James Yu
March 25, 2015

Chart New Territory with Parse Explorer

Parse Explorer

Today we’re excited to announce a new, powerful debugging tool for production issues in your Parse app: the Parse Explorer.

For a large app, it can be complicated to track down when something is going wrong. With thousands or millions of API requests, how do you fix it when a small fraction of these are broken? How do you improve it when some section of them are running slowly?

The Parse Explorer offers a powerful query language to let you investigate what’s happening with a subset of your app’s API requests. You can use this powerful query language to dig through timestamped, heavily denormalized logs tracking each bit of communication that your app does with Parse. This approach is powerful, yet simultaneously easy to use.

We’re also surfacing something we’ve never explicitly exposed before: the measured latency on each of your requests. We start counting immediately upon receiving your API request and stop counting right before we return a response, so you know just how long your app was waiting for Parse to do its work. We think it’s a pretty powerful way to start drilling down on which actions are most costly for your users.

Here’s an example. Say our Parse app is growing and we want to figure out what part of the app the increased usage is coming from. Here’s where we start:

Explorer Hero

We don’t know what sort of data we’re looking for yet, so let’s pick the most flexible format choice: a table.

We’ll start off by looking at the pure number of requests, grouping by time to confirm that this usage is growing. We’ll also group by request type hitting Parse to confirm that the distribution of requests is what I’d expect of my app.

Explorer Group By Day

Sorting by the Count of rows tells us that — yep, the last few days have all been pretty active, and the most common type of request that has recently taken place is an update. I wonder if we can figure out which classes are receiving those updates — and from there, why.

Explorer Which Classes

Either my app is going through crazy growth, or there’s something funky going on with extra _Installation updates hitting Parse — and if we keep digging in, we’ll discover more and more. Check out the Parse Explorer for your app and let us know what you think! Access will be rolled out gradually to accounts on Parse.com, so keep an eye out and think about what you’d like to see next. Happy exploring!

 

Christine Yen
March 25, 2015

Introducing Cloud Code Webhooks

Webhooks

Ever since launching Cloud Code, we’ve been amazed at what Parse developers have built with bits of JavaScript code. From simple object mutations to complex game state management systems, Cloud Code has proved to be a versatile tool. But one of the biggest requests we’ve received is the ability to run any kind of language or framework to manipulate your data.

Today, we’re excited to announce the launch of Cloud Code Webhooks. With this, you can now specify any URL to receive a POST in response to triggers like beforeSave and afterSave on objects, as well as when a Cloud Function is called. You now have the freedom to write code in whatever language you want. As long as you have a server running it, your Cloud Code can integrate with it.

To get started, head over to the new Webhooks section located in the Core dashboard. For example, let’s say you want to hit your server at www.example.com/process_puppy whenever a Puppy object is saved. All you have to do is specify this as a beforeSave webhook:

Screen Shot 2015-03-24 at 8.06.32 PM

When Parse receives a request to save a Puppy, your server will receive a POST with the following JSON payload:

{
  "object": {
    "className": "Puppy",
    "name": "Spot",
    "type": "Corgi",
    "age": 1
  },
  "triggerName": "beforeSave"
}

Now, your server can process the Puppy data however you want. In addition to these parameters, you can get data about the User, Installation, and other relevant fields.

Similar to regular Cloud Code triggers, you can change the Puppy by returning a 200 response with an altered object. For example, if you wanted to change the name of the Puppy to Rover, you would return:

{
  "success": {
    "className": "Puppy",
    "name": "Rover",
    "type": "Corgi",
    "age": 1
  }
}

The possibilities are endless. Perhaps you want to reliably save and process all your object data for offline analytics. You could easily stand up a Rails app on Heroku to receive this. Or, maybe you have extensive experience running LAMP stacks on AWS—now it’s possible. Whatever server you love, Parse can integrate with it.

Check out more in our Cloud Code Guide on Webhooks and get started today.

James Yu
March 25, 2015

Announcing Enhanced Sessions

Enhanced Sessions

At Parse, we’re constantly striving to provide the tools you need to make your app more successful. One of the most important aspects of an app’s success is security, so that people can trust your app when they use it. Parse already provides several tools to secure your app, including Access Control Lists (ACLs) for Parse Objects, Class-Level Permissions for each data table on Parse, and Cloud Code for even more in-depth security customizations. Today, we’re excited to announce an update to our previous sessions functionality. With the new Enhanced Sessions feature, we’re giving developers and people more control than ever over data security.

Prior to this launch, if a user logged into your app through multiple devices, this same session token was shared across all devices. This session token was not revocable, and upon logging out, the token was not destroyed.

Now, with Enhanced Sessions, the Parse Cloud will assign a unique revocable Session object for each user on a given device for your specific app. This means different devices and web browsers will have different session tokens for the same user in your app. On mobile and web apps, you don’t have to worry about creating and destroying sessions yourself. When users log in or sign up, the Parse Cloud automatically creates the corresponding Session object. When users log out, the Parse Cloud automatically destroys the corresponding Session object, which invalidates the session token that was previously assigned to that user’s device.

We’re also introducing a flexible Revocable Sessions API that lets you easily understand and securely manipulate user sessions in your app. You can see your app’s Session objects in your Parse account’s Data Browser, just like any other Parse object. If a user contacts you about his or her account being compromised in your app, you can use the Data Browser, REST API, or Cloud Code to forcefully revoke user sessions using the Master Key. These new APIs also allow you build a “session manager” UI screen where your app’s users can see a list of all devices they’ve logged in with, and optionally log out of other devices. This empowers people who use your app to help monitor and protect their accounts. In addition, for increased security, you can configure your app to automatically expire user sessions due to inactivity.

Sessions

Today, we also announced Parse for IoT. The Revocable Sessions API lets you implement scenarios where people can use your app on their phone to provision restricted user sessions for their IoT connected devices. This not only allows IoT devices to securely access user data, but also protects your users’ accounts in case their IoT device gets stolen. For example, the session token on an IoT device cannot be used to modify User objects on Parse.

The new Revocable Sessions API is available on all Parse SDKs (iOS, Android, C#, JavaScript, PHP) as well as our REST API. All new Parse apps created after today will have Revocable Sessions enabled by default (configured in your app’s Parse.com dashboard settings page). You can use existing login/signup/logout APIs in the same way as you did prior to this new feature. The only significant change is that you’ll have to handle a new invalid session error on Parse API requests, and prompt the user to log in again when necessary. Your app will encounter this invalid session error when that device’s user session token is revoked from elsewhere. This happens when your user logs out of that phone from the “session manager” screen of another phone, or when you (the app developer) use the Master Key to programmatically delete that Session object in the Parse Cloud.

If you currently have a production app on Parse, we recommend that you upgrade to the new Revocable Sessions API as soon as possible to take advantage of the new, more secure model with unique tokens for each device, and the ability to easily revoke user session tokens when necessary. We’ve prepared a Session Migration Tutorial to help you upgrade your app smoothly.

For more about our Revocable Sessions API, please see our documentation.

Stanley Wang
March 25, 2015

Secure Your App, One Class at a Time

Security is one of the most critical aspects of releasing a production app, and with Parse there are lots of ways you can secure your app. As Bryan laid out in his 5-part security series, Parse provides a powerful security toolset, including the master key, Access Control Lists (ACLs), Class-Level Permissions (CLPs), and Cloud Code. Every successful production app uses some features out of this toolset, and we are always working to improve its ease of use for Parse developers to take advantage of these effective tools. A few months ago, we released an updated ACL editor, making it much easier to view and edit ACLs in the data browser. Today we are releasing a new and improved CLP editor, so you can view and edit your app’s Class-Level Permissions just as easily as its object-level ACLs!

Just like ACLs, CLPs are lists of users or roles that can access a specific class of your app. As with ACLs, you can give each user/role read or write access. Let’s see how this works in an example. Say we have a restaurant app, with a Restaurant class. To edit the CLPs for the Restaurant class, click the ‘Security’ button at the top of the data browser. This will open the new CLP editor, and you will notice that the default permissions for every class is public read and write (with some exceptions).

Screenshot 2015-02-10 20.35.50

You may notice that this looks strikingly familiar to the ACL editor. Right now the Restaurants are completely public, meaning that any user of the app can see every Restaurant, and can change every Restaurant. We probably don’t want Restaurants to be completely public, because then any user could just delete all the Restaurants in the database and our app wouldn’t do much after that. So, let’s disable public writes.

Screenshot 2015-02-10 20.42.18

Now any user can see all the Restaurants, but nobody can change any Restaurants (without the master key). But maybe I want my own user to be able to create new Restaurants, or update old ones. I can add my user to the CLP editor by typing in my username or objectId, and allow writes for that user by clicking the “Write” checkbox.

Screenshot 2015-02-10 20.48.07

Now the jamie user can do whatever he wants with all of the objects in the Restaurant class, while no one else can write to this class. But maybe there are some other users that should be able to write to this class, and I don’t want to keep adding each user one-by-one. Let’s use a role, which we’ve named admin . First we add all the users we want to have write access to the admin role, then we type the role name into the next row, and finally we enable write access by clicking on the “Write” checkbox.

Screenshot 2015-02-10 20.59.40

Any user in the admin role can now make changes to the Restaurant class. But what if we want to let some other group of users – those in the chef role – add new Restaurants, but not be able to edit existing Restaurants? To do that, we first click the settings gear at the top-right of the editor, and switch to the “Advanced” mode of the editor. In the advanced mode we can set more specific permissions on the class for different request types.

Screenshot 2015-02-11 16.28.18

There are 6 types of permissions you can manage in the CLP editor, based on the different types of requests you can make to Parse. We group these permissions into “Read” and “Write” categories, with the exception of “Add Field”.

  • Read:
    • Get — With Get permissions enabled, users can fetch objects in this class if they know their objectIds.
    • Find — Anyone with Find permissions enabled can query all of the objects in the class, even if they don’t know their objectIds. Any table with public Find permissions will be completely readable by the public, unless you put an ACL on each object. (with some exceptions)
  • Write:
    • Update — Anyone with Update permissions enabled can modify the fields of any object in the class. For publicly readable data, such as game levels or assets, you should disable this permission.
    • Create — Like Update, anyone with Create permissions enabled can create new objects of a class. As with the Update permission, you’ll probably want to turn this off for publicly readable data.
    • Delete — With this permission enabled, users can delete any object in the class. All they need is its objectId.
  • Add Field — Parse classes have schemas that are inferred when objects are created. While you’re developing your app, this is great, because you can add a new field to your object without having to make any changes on the backend. But once you ship your app, it’s very rare to need to add new fields to your classes automatically. So you should just about always turn off this permission for all of your classes when you submit your app to the public.

Going back to our example, we wanted to ensure that all users in the chef role could create Restaurants, but we don’t want them to be able to update or delete any existing restaurants. To accomplish this we simply add a row for the chef role, and check “Create”.

Screenshot 2015-02-11 16.27.43

We could add permissions for any of the other types of requests in just the same way. CLPs are an extremely powerful tool for quickly and easily securing your app. But before you add a bunch of CLPs to your app, make sure you understand how CLPs and ACLs interact with each other.

We are excited to continue giving Parse developers better ways to secure their apps, and we hope this helps you launch safer, more secure production apps! Go check out the new editor in the data browser, and as always, let us know what you think!

Jamie
February 23, 2015

Parse Local Datastore for iOS

Local Datastore for iOS

Too often, we’ve seen bad reception or lack of connectivity become the downfall of what could have been an incredible user experience. Many mobile apps are simple clients that display data straight from a server, losing all functionality without an internet connection. Because of this, people who use these apps face painful loading screens and broken features. The developers who build these apps want a better experience, but it’s not easy to build all the underlying logic to handle local data storage gracefully.

Parse Local Datastore makes it a lot easier, and today we’re excited to announce that it’s available in our iOS/OS X SDK. You can now create a seamless, uninterrupted user experience free from connectivity constraints.

It’s the same functionality found in our Android implementation, but now for iPhones , iPads, and Macs everywhere. [PFObject pin] persists PFObjects to the Local Datastore and [PFObject unpin] removes them. Once pinned, you can access them anytime with a normal PFQuery:

PFQuery *query = [PFQuery queryWithClassName:@"Feed"];

// Pin PFQuery results
NSArray *objects = [query findObjects]; // Online PFQuery results
[PFObject pinAllObjectsInBackground:objects];

...

// Query the Local Datastore
[query fromLocalDatastore];
[query whereKey:@"starred" equalTo:@YES];
[[query findInBackground] continueWithBlock:^id(BFTask *task) {
// Update the UI
}]];

Pinned PFObjects will remain accessible while offline — through app exits and restarts — until they are unpinned. Subsequent saves, updates, or deletes will keep your Parse Local Datastore results up-to-date.

You can also choose to update your object using the PFObject method saveEventually. This will first update its instance in the Local Datastore and then do so remotely, so any changes can be kept up-to-date while offline:

feedItem.starred = YES;

// No network connectivity
[feedItem saveEventually];

...

PFQuery *query = [PFQuery queryWithClassName:@"Feed"];
[query fromLocalDatastore];
[query whereKey:@"starred" equalTo:@YES];
[[query findInBackground] continueWithBlock:^id(BFTask *task) {
// "feedItem" PFObject will be returned in the list of results
}]

This also means that if you’re already using the PFObject method saveEventually to protect your app against network failures, you’ll get most of this without any additional work–simply by updating to the latest iOS/OSX SDK and enabling Local Datastore.

With Parse, it’s easy to take your app offline! Check out our guide and API docs to get started now.

Grantland Chew
December 9, 2014

Introducing Parse Crash Reporting

Crash Reporting

We at the Parse London office are happy to announce Parse Crash Reporting: the simplest way to register, track, and resolve crashes in your apps. Being able to capture and fix crashes efficiently means fewer frustrated users and better retention–one of the most important metrics to any developer.

In the past, we’ve seen Parse developers use third-party crash reporting tools, but this approach required developers to manage several different SDKs, learn new APIs, and monitor many dashboards at once. We wanted it to be simpler. Part of Parse’s core mission has always been to abstract away common tasks and streamline the developer’s experience — so we built a way to manage crash reports right within Parse.

Crash Reporting

Say you’ve released a new version of your app that unfortunately “features” a newly introduced bug. Have no fear! All you have to do is enable Parse Crash Reporting, making the experience of handling crashes in your app much smoother than ever before. We’ve updated our iOS and Android SDKs to provide a simple and intuitive interface that detects the bug, pinpoints the issue, and generates a report allowing you to resolve problems quickly and easily. With this update, our SDKs automatically cache and resend your crash reports if connectivity is spotty. And, our backend tracks bugs on a per-version basis, so that if you’ve reintroduced an old bug in a new version of your app, Crash Reporting still ensures you’ll notice and fix it as soon as possible—even if you’ve previously marked it as “resolved.”

Here’s an example snippet showing how you can enable Parse Crash Reporting for Android:

ParseCrashReporting.enable(context);

Here’s an example snippet showing how you can enable Parse Crash Reporting for iOS:

[ParseCrashReporting enable];

As you may have expected, the sending of crash reports from the client is asynchronous and takes place automatically in the background.

We’re always looking to improve our products and would love to hear your feedback. Check out our guides, try it out, and let us know what you think!

Islam Ismailov
December 9, 2014

Migrating from Urban Airship

Making mobile development as easy as possible has always been our mission at Parse. And ensuring your data is portable and remains yours is an important part of that mission. We’ve worked hard on improving the accessibility of your data on Parse and are committed to ensuring our customers can access their data at any time.

In that spirit, we also want to make sure new customers are able to easily migrate from other providers to Parse. We noticed that the push notification provider Urban Airship recently made their product paid only. So, a few of our engineers spent a weekend building a very simple migration tool. This tool will import all of your Urban Airship push subscriptions for iOS and Android (GCM) devices to Parse. Simply enter your Urban Airship app key and secret and we’ll take care of the rest!

Parse Push allows developers to send unlimited push notifications to up to 1 million devices for free every single month. Beyond that, the pricing is simple: you’ll pay $0.05 a month for every 1000 extra devices. That’s $50 for another million devices, and you can send them as many pushes as you want.

image

After the import is complete, check out the Data Browser to see all of your data. You can then immediately start sending pushes to existing devices without requiring an update to your app. Until you require an update, you can continue using the migration tool to import any new devices. Don’t worry, we’re keeping track of which ones you’ve already imported, so there won’t be any duplicates. Once you’ve integrated the Parse SDK and updated your app, new devices will start showing up in Parse. You can then start taking advantage of our powerful analytics features. To learn more about the steps of migrating to Parse, take a look at our tutorial that will guide you through the whole process.

We’re excited for you to experience all that Parse has to offer. With Parse Push, you can now enjoy device targeting, in-depth analytics, and timezone and badge increment support for your push messaging. Plus, don’t miss our brand new A/B testing feature — engage with your users more intimately and effectively than ever before.

If there’s any other importer you’d like to see, let us know!

Mattieu Gamache-Asselin
December 8, 2014