Twitter: raymondcamden


Address: Lafayette, LA, USA

Building a Parse.com Enabled PhoneGap App - Part 5

10-24-2012 16,556 views Mobile, Development, JavaScript, HTML5 12 Comments

Welcome to my final entry on using Parse.com services with PhoneGap. I apologize for taking so long to get this entry out the door. Blame Germany. (I blame the Maß.) In this entry I'll be wrapping things up and discussing what should be done to get the application to market. Both on the PhoneGap side as well as Parse. Let's begin with the PhoneGap side.

Preparing Your PhoneGap App

I mentioned that I was making use of PhoneGap Build to create applications out of my source code. In order to publish to the Android and iOS markets, you need certificates for both. Instructions for how to do that are beyond the scope of this blog entry, but you can find good documentation for both.

Android - Signing Your Applications
iOS - App Store Resources

The Android set up is relatively simple and can be done in about 5 minutes. For iOS you will need a developer account ($99) to even read the docs behind the link above. I find the iOS certificate process quite a bit more confusing than Android, but after doing it a few times, I've gotten it down to about a half hour process.

The good news is that once you have created the certificates for both platforms, PhoneGap Build makes it super easy to use them. You simply upload the proper documents and then edit your project to ensure they point to them.

Once you've done that, you can generate release builds just as you would any other build. Simply update your code and PhoneGap Build will do the hard work for you.

Submitting to the various app stores is also a bit out of scope for this post. As we all know, Android makes this relatively easy. You're app can be public in about half an hour. iOS is more of a waiting game. (Details on my own app at the end of this entry.)

Locking Down Parse

In this series (and other blog entries), I've raved about how darn cool Parse is. But you may be wondering - if code can be used to generate any type of object, what happens when someone gets a hold of my JavaScript code and creates ad hoc data? Thankfully, Parse's dashboard has a way to handle this.

The very first thing you will want to do is go into your application setting and disable "Allow client class creation."

This will prevent hackers and ne'er-do-wells from adding random types of data to your storage. (In case you're wondering - I did this for my application.)

The second option you have is a bit more involved. Parse allows for full ACLs (Access Control Lists) over data. By default it's free for all. Anyone can make anything. You can disable this globally in the settings by disabling anonymous users:

But most likely you want to provide more fine-grained control. Parse allows you to control access at the type and object level. Here is a screen shot of the permissions screen for the TipObject.

As you can see, you have incredible control over your data and how people will be able to interact with it. I disabled both Delete and Add Fields. But you have many more options here. You can assign users and roles to specific permissions based on whatever your application's needs are.

The main point is - even with this being an open source JavaScript-based application - Parse.com still allows me to lock down access to prevent people from going crazy with the application. That's an awesome feature and truly makes the service worthwhile I think.

Wrap Up

So - I actually did submit my application to both the Google app store and iOS. Unfortunately, Apple turned me down. Why?

We found that your app encourages fraudulent or reckless activity, which is not in compliance with the App Store Review Guidelines.

In all fairness, they're probably right. Most cow tipping would probably involve a bit of trespassing, which is, technically, against the law.

Luckily Google ain't a prude like those fellows over at Apple!

You can download the app right now if you're really, really into actually tipping cows.

So - that's the end of this series. I do plan on doing more blog posts though. Specifically, I'd like to demonstrate how to connect PhoneGap/Parse.com apps to Facebook. I imagine that would be of interest to folks. I'm also open to any suggestions about what topics to cover. Just let me know!

Related Blog Entries

12 Comments

  • Commented on 10-25-2012 at 2:01 AM
    "but after doing it a few times, I've gotten it down to about a half hour process."

    I don't think I'll ever get it lower than that, and that's only if I've already got the key chain access rubbish sorted out on the mac before hand.

    I've not tried an Android app submission yet, I look forward to trying it.
  • Commented on 10-25-2012 at 9:04 AM
    Given what you have to do to sign up for Apple's Dev program, I'm surprised they haven't built a simple form for this. I mean, they do have nice forms and stuff, I just mean like a 'one click form'. Then again - I'm lazy. :)
  • sam #
    Commented on 10-25-2012 at 9:50 PM
    awesome series! Looking forward to the FaceBook integration tutorial!!
    On a side note. Do you know of any mobile app theme templates out there? I can't even find them for ios, as it would be too hard to tweak css to make a html5 app look native..
  • Commented on 10-26-2012 at 7:13 AM
    There are a couple. The ones I'm familiar with are jQuery Mobile and Twitter Bootstrap's responsive stuff.
  • april j #
    Commented on 10-28-2012 at 3:49 PM
    Nice series! Thanks. I feel like I am armed with enough info now to prototype an idea out using parse.com
  • Jim #
    Commented on 10-30-2012 at 9:20 AM
    Great series of articles - if you get a minute - any chance or a tut on a)client database/storage synchronisation with parse for offline/online use b) login authentication using parse. Or both as Christmas is coming up!
  • Commented on 10-30-2012 at 9:36 AM
    a) I already did one. :)

    http://www.raymondcamden.com/index.cfm/2012/9/14/E...

    b) I'm working on a user demo now. Spoiler - Parse's built-in "user" support is freaking incredible. They cover everything.
  • Alex #
    Commented on 10-31-2012 at 12:41 PM
    I would love to see a facebook login authentication using parse and phonegap at the same time (they don't seem to like each other, regarding the passing of the authtoken etc.) and of course, how you can make use of the powerful parse push notification feature in conjunction with phonegap. I just stumbled over your blog, love it. Greetings from Germany!
  • Commented on 10-31-2012 at 1:07 PM
    Alex, just today I blogged on Parse/User stuff. I don't cover Facebook/Twitter yet, but I plan to next.
  • Nick McIntosh #
    Commented on 11-04-2012 at 9:56 PM
    Thanks for the excellent blog posts, I'm using them to start making an app. It would be teriffically helpful to have a post on integrating Facebook with a phonegap/parse app.

    It's difficult to know how to get either the Phonegap Facebook plugin to play with Parse, or how to get the Parse Facebook SDK to work without requiring a site URL.

    The phonegap plugin sounds great, utilising the single sign on facility on iOS. And obviously Parse's automated User creation using Facebook details is great too.

    Your help via a blog post would be very much appreciated, I'm sure.
  • Brandon Murray #
    Commented on 11-27-2013 at 7:00 AM
    Did you ever get a chance to work on the Facebook integration?
  • Commented on 11-28-2013 at 6:38 AM
    No, sorry, I didn't.

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty