Parse.com – Corona SDK integration tutorials updated!

hi, everyone. I have updated the Corona SDK – Parse.com codebase to account for Graphics 2.0 changes, fixing a bug, and using Develephant’s Parse_Mod module which makes Parse integration really easy. This repo includes the entire codebase, please fork it and have fun with it!

– I needed to fix the layout of the screen to better account for different screen sizes. Also the colors were impacted by the changes made for Graphics 2.0 so there are a bunch of tweaks to make everything look nice again. Buttons as well are reskinned. One thing you need to do if you try to device test this codebase is to add the Default-568h.png file to your root to avoid letterboxing (this graphic functions as the tall device splash screen, it’s a little Apple kludge).

– There is a lot going on in this codebase so you can walk through the tutorials while referencing this new set of code. It allows you to register a user with a favorite dessert flavor, email the user a welcome message, counts how many people are associated with the flavor and displays that for a user, allows the user to take a picture and upload it to Parse.com, and sets the app to accept push notifications.

– There was a bug in the old code and the cloud code that caused an error to be thrown if no one happened to have selected the flavor of the day, so that’s corrected in the lua code; below I’ve pasted the cloud code that you need to edit (see the tutorial on Parse cloud code if you need pointers on how to set it up).

Here’s the cloud code:

// Use Parse.Cloud.define to define as many cloud functions as you want.// For example:
Parse.Cloud.define("getFeatured",function(request, response){//response.success("chocolate");//this code assumes that we know the flavor of the day is chocolate. We count how many users //like chocolate, even if none do. We return either the string 'chocolate' if there are no //users with that favorite, or a table of users if there are.var query =new Parse.Query(Parse.User);
query.equalTo("favorite","chocolate");
query.find({
success:function(results){if(results.length==0){
response.success("chocolate");}else{
response.success(results);}},
error:function(results,error){
response.error(error);}</code>});});//mailgun
Parse.Cloud.define("sendEmail",function(request, response){var Mailgun = require('mailgun');var email = request.params.email;
Mailgun.initialize('dessertometer.mailgun.org','your-mailgun-key-here');
Mailgun.sendEmail({
to: email,
from:"dessert-o-meter@ladeezfirstmedia.com",
subject:"Welcome",
text:"Welcome to the Dessert-O-Meter!"},{
success:function(httpResponse){
console.log(httpResponse);
response.success("Email sent!");},
error:function(httpResponse){
console.error(httpResponse);
response.error("Uh oh, something went wrong");}});});

Hi Jen – Would be interested in whether you looked at alternatives to Parse and whether Parse is more suited for Corona developers for some reason? I’m most concerned about (all go well) the risk of getting lots of downloads/usage on a freemium game and whether the ads would pay for the cost of parse when you exceed the free plan limits…

hi, I have used both Parse and Kii, with Parse far better than Kii. I think any of those alternatives are worth trying, for sure. I don’t think one is better than the other, the only thing that will probably impact your choice will be cost. This is why Chris is developing Chromium which is self-hosted and thus unlimited. It sounds like a great alternative if you don’t mind self-hosting (I prefer a managed solution). One thing to remember is I don’t tend to develop games that have a chance to go viral, lol, I develop business apps.

So find something that works for you and let me know how you like it! I actually would like to look at Kinvey and may do that in the future.

hey Greg, this is what happens when I’m jet lagged and respond to emails. The name of Chris’s project is Coronium, not Chromium. Also, I did take a look at Kinvey briefly after our exchange of emails. I think that the thing that makes Parse work so well for us is that it has good documentation and a well-developed REST API module. That’s really what I’m looking for. Kinvey’s isn’t so great, as it turns out, based on my brief review of their docs. Parse has a lot of built-in sugar that we can easily leverage.

Hi admin, I am newbie to Android apps, REST API, Http and to Parse.com. My goal is to get information from an android device through request from PC and finally display the collected information in PC. I have developed an Mobile android app which displays information when I click a button. I don’t think Parse.com help in developing a new REST API from scratch. I went through their website and others and I am confused where to start as I don’t know where to start. Please guide me. Thank you!