A Parse.com Module for Corona SDK

Hello 1st again thank you so much for this module:

Same problem here already downloaded 2.0.2

/Users/joeleya/Google Drive/PFA App/The App/Inquire.lua:232: attempt to index field ‘response’ (a nil value)

stack traceback:

/Users/joeleya/Google Drive/PFA App/The App/Inquire.lua:232: in function ‘_callback’

/Users/joeleya/Google Drive/PFA App/The App/mod_parse.lua:972: in function ‘onResponse’

/Users/joeleya/Google Drive/PFA App/The App/mod_parse.lua:773: in function </Users/joeleya/Google Drive/PFA App/The App/mod_parse.lua:773>

 

Thank you so much in advance.

Hi,

Please try the latest version 2.0.3 here https://github.com/develephant/mod_parse

Hopefully that will finally solve the issue.

Cheers.

Hi @develephant,  hope this thread is still going good yeah.

I need some advice, how good is parse currently (in addition to all the mod_parse that you’ve done and updated till now), is it able to be used for Real-time Mobile MOBA game app? lets say 4v4 maximum players in a match.

Warm Regards.

Hi, first of all: awsome job Develephant. I remember when you posted this for the first time, but I wasn’t into networking features so I just skipped but knowing there was a feature available if I wanted to try it.

Since a couple of weeks ago I’ve been trying to set up a decent networking structure and managed to have a working LAMP local server (had 0 experience in unix systems). While it was really fun to do, there is a lot of thing to configure, performance to be done, and $$$ to be spend (server/hosting, SSL, etc)

I then remembered about Parse and this module and gave it a try. Had a hard time during the first time, but I blame my inexperience with networking resources (and usually get the idea of how to use a new library). Anyway, after that I understanded a lot more and managed to make a make a good structure.

Now i’m getting into a problem here. Users are being logged in automatically after the first login, this works… but in my parse console there is a session being created everytime i log in the user with this code:

-- i get these from other part user = MYUSER pass = MYPASS local function onLoginUser(event) if not event.error then print("connected") else print("Login error") end end parse:loginUser( { ["username"] = user , ["password"] = pass }, onLoginUser )

Now the question is… since the sessions expire after 1 year of being created, is it OK to generate one everytime an user logins? Where and how whould you use them if not? 

Thanks in advance, and thanks again for the awsome mod

First of all, Develephant, you are my favorite elephant. That is high regard. :wink:

Okay, here’s why I’m here right now. Sending and receiving data with Parse.com using your module is working wonderfully. However, although that is working, the listeners to the mod_parse functions are not being called. I’ve tried the simplest example, which I pulled from your tutorial (this one).

local parse = require( "mod\_parse" ) parse:init({ appId = "myAppId", apiKey = "myAPIKey" }) parse.showStatus = true parse.showAlert = true parse:appOpened() local function onCreateUser( event ) --nothing in this function is read print( event.response.createdAt ) print( event.response.sessionToken ) print("hi") --extra indicator end local userData = { ["username"] = "Chris", ["password"] = "1234" } parse:createUser( userData, onCreateUser )

I would imagine this is an easy fix (whichever side it’s on). At least, I hope it is.

Thank you,

Nathan

Hey Develephant, 

I just wanted to post here and let you know the latest version 2.1.3 on github seems broken. Any time you try to login, it returns a token errror. At least for me. Registration seems a little wonky as well. It will register accounts and say that the user already exists even though it really doesn’t. The bug was on and off when I tried to create accounts. So it was impossible to recreate the bug unless for whatever reason it decided to. Did you accidently create AI? The registration was successful sometimes, but other times it wasn’t. This also returned an error from the session token. My code did not work at all using 2.1.3, so I reverted back to 2.0.3 and everything works fine right now. Just wanted to give you a heads up.

Thanks

Hi,

Parse has made some pretty major changes recently so I’m in the process of getting the mod current.  I’m surprised people are having issues still with 2.1.3 as it has passed all testing many times.  I’ll keep trying to break it.

@Nathan B - I will double check the event code.  My apologies.

Cheers.

Just adding my 2 cents, i currently have an app in the 3 app markets with version 2.1.3 with no issues. The only thing different in mine from the example above is that I am using Facebook to login.

Thanks for the confirmation agramonte.

There have been some changes to Parse session handling though.  You can try turning these options off if you’re having session issues.

https://www.dropbox.com/s/rkhbh22rubip1l9/2015-07-21_1342.png?dl=0

I’ll be looking into updating to the new system soon.

Cheers.

For users to login I created a custom login scene that utilizes the parse:loginUser function. To be exact, here is my code:

parse:loginUser( { ["username"] = userCode, ["password"] = passCode}, onLoginUser )

Just to make sure I was not going insane I tested it again. It’s still doing the same thing. When I log in with 2.0.3 it works flawlessly. With 2.1.3 I keep getting a error when logging in. User credentials are exactly the same in each case. I took pictures if you want me to post them up. The onLoginUser function is pretty much what you use in your examples with slight changes. The changes don’t impact your parse functions though. Also, in relation to the image from Drop Box you posted, all those settings are turned off in my parse account.

EDIT: I just want to elaborate on how I am calling the parseLogin. I use it in a button event. When the button event is over, meaning I left go of the button, that’s when the parse:loginUser is called.

Thanks

I like the new twitter plugin but is there anyway to use that to sign in with parse?

I know your busy with coronium, how is android push coming?

I found this article, It might help with android push

http://www.tech.pink/using-corona-with-parse-for-push-notifications/ 

@scottrules44 - I have not had a chance to look at the Twitter plugin.  You might try pinging the author.

Also, as a general note to all Parse mod users, please report all issues in the tracker at the repo here.

I want nothing more than to solve any errors, but it takes up too much dev time trying to collect issue reports from the develephant.com comments, Twitter, email, PM’s, this forum, etc.  So help me help you, please only report issues on the tracker, other means will (probably) be ignored.  ^_^  An issue report doesn’t have to be anything elaborate.

Thanks again for using mod_parse with Corona SDK!

Cheers.

Cool, android push?, also have you been able to reproduce the event.error bug?

Hi all,

A new, well worked over, version of mod_parse is now available at 2.2.3.  Hopefully this should solve the outstanding issues.  Any testers appreciated. Please read over the release notes to see what has changed.

Android push is still coming.  I need to set up my phone for testing.

mod_parse 2.2.3 release notes

http://develephant.github.io/mod_parse/

Cheers.

Awesome :slight_smile:

The mod_parse module has been updated to fix some critical issues.  Thanks reporters!

I’ve also put together a quick recipe on how you login, upload a file, and link it to the record on Parse. It demonstrates some best practices for using mod_parse.

Please report any issues to the tracker.

Cheers.

Hi develephant,

You work is amazing. We are using your mod_Parse and we would like to send you money for this as we know dong work like this require many, many hours of hard work. What is the process please ?

Nick

Hi,

Thank you for the kind comments.  mod_parse has been around for a year and a half now, so yes, many hours. :slight_smile:  I’m thrilled it’s working for your needs.

Your offer of a donation towards the work is very gracious of you.  Feel free to use the coronium.io PayPal page. If you’d prefer another method, go ahead and PM me.

Thank you so much, and look out for the mod_parse 2 beta. :wink:

Cheers.

Hi Develephant, 

thank you for this amazing hard work, you moved from a lower place as developer to an upper one, thank so much for this.

I still have one problem if you don’t mind. I cannot check if session has expired or not, because obviously the function doesn’t work, and I get error that says :

File: mod_parse.lua

Line: 568

User must be logged in first, sessionToken cannot be nil.

my code is :

[lua]

local parse = require(“mod_parse”)

parse:init({

appId = “…”,

apiKey = “…”

})

parse.showStatus = true

–count event

–parse:appOpened()

–parse:logEvent( “Share”, { [“screen”] = “splash” } )

–parse:logEvent( “Share”, { [“screen”] = “results” } )

local function onCreateUser( event )

  print( event.response.createdAt )

  print( event.response.sessionToken )

end

local userData = { [“username”] = “Ali”, [“password”] = “121212” }

– parse:createUser( userData, onCreateUser )

local function onLoginUser( event )

  if not event.error then

    print( event.response.objectId )

    --check if user is verified

    if event.response.emailVerified then

      --user is verified

    end

  end

end

parse:loginUser( { [“username”] = “Ali”, [“password”] = “121212” }, onLoginUser )

local function onGetMe( event )

  if event.code == parse.EXPIRED then

    print( “Session expired.  Log in.”)

  else

    print( “Hello”, event.response.username )

  end

end

parse:getMe( onGetMe )

[/lua]

I want to know how to fix this and continue learning about your great _mod.

thanks.