Share Your Code

Parse for Corona SDK

Posted by Dotnaught, Posted on April 16, 2012

GitHub URL: 
https://github.com/Dotnaught/Parse-for-Corona-SDK

This sample project shows how to communicate with Parse.com, a back-end data service, from a Corona SDK app. You should be able to adapt it to your needs with minimal changes. See main.lua for a barebones UI.

To use the parse.lua module, add:

1
local Parse = require("parse")

to your main project file and refer to functions as shown in main.lua.

You'll want to use SDK build 2012.782 or later, for support of HTTP methods PUT and DELETE.
http://blog.anscamobile.com/2012/04/storyboard-network-changes-and-more/

See the Parse API for details:
https://www.parse.com/docs/rest#general


Replies

MiClosStudio
User offline. Last seen 1 day 8 hours ago. Offline
Joined: 22 Jan 2011

Thanks a lot!

ne.hannah
User offline. Last seen 3 days 20 hours ago. Offline
Joined: 18 Jan 2011

Good stuff!

nate2
User offline. Last seen 1 year 13 weeks ago. Offline
Joined: 17 Mar 2012

Awesome. Thanks!

bob.dickinson
User offline. Last seen 39 weeks 10 hours ago. Offline
Joined: 15 Dec 2011

I was working on this also (replacing my current S3 and SimpleDB backend with a Parse backend).

My app only authenticates via Facebook, and to do that with Parse you need the token and expiration from the FB login. Corona only provides the token. I filed a feature request tonight to add the expiration (in the same place they provide the token - in the callback from login).

It's probably a 5 minute fix for them. But who knows how their prioritizing system works.

potsifera
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 7 Jul 2011

thanks

potsifera
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 7 Jul 2011

hey bob, just wondering if you could point me out the best way to get the date in YYYY-MM-DDTHH:MM:SS.MMMZ format with millisecond precision from event.expiration ? thanks in advance

bob.dickinson
User offline. Last seen 39 weeks 10 hours ago. Offline
Joined: 15 Dec 2011

The expiration did get implemented by the Corona folks. I had some back and forth with Walter and a guy from Parse (David Poll) with respect to the granularity of the expiration. Walter explained that all they got from the FB API was a unix time (without the granularity implied by the Parse API spec).

David from Parse said "We use the token expiration as part of our validation of the token. You should be able to send us the unix time converted into the format described on the REST API page."

So you don't need to worry about the precision, you just need to convert/format the provided expiration time per the Parse spec.

I actually put my Parse work on the back burner, so I haven't gotten to this yet. I'm hoping to get back to in within a week or two.

neoroman
User offline. Last seen 6 weeks 6 days ago. Offline
Joined: 23 Jan 2012

Thanks!

horacebury
User is online Online
Joined: 17 Aug 2010

Did you get create object working?

https://parse.com/docs/rest#objects-creating