Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

A Parse.com Module for Corona SDK
Started by Develephant Dec 08 2013 07:24 PM

* * * * * 1 votes
85 replies to this topic
[TOPIC CONTROLS]
Page 2 of 4 1 2 3 4
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

FYI Netmera has a free tier and can support iOS and Android push.



[TOPIC: post.html]
#27

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

@jonjonsson Wow!  That looks promising as well.  I'll be taking a closer look at that tomorrow.  Thanks for the tip.

 

Have you used the service?

 

Best.



[TOPIC: post.html]
#28

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

@jonjonsson Wow!  That looks promising as well.  I'll be taking a closer look at that tomorrow.  Thanks for the tip.

 

Have you used the service?

 

Best.

 

I'm using it but I'm not in production yet so I have limited experience with it. There was a period when they where updating their services and their Rest API seemed have fallen between the cracks or something and it was not working for a day or two. I'm still going with them though but a bit more cautiously.



[TOPIC: post.html]
#29

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 526 posts
  • Corona SDK

hi guys,

 

I am starting to look into push notifications too. I was reading this corona guide : http://docs.coronalabs.com/guide/events/appNotification/index.html

 

 

It recommends usage of services... " ...PushWooshUrban Airship, or Parse that specializes in push notifications."

 

Is it hard to implement push notifications (Android & iOS) without the usage of these services ?  Would like to hear your experience.

 

 

Thanks



[TOPIC: post.html]
#30

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

@yosu Hard is relative of course, but there are ways to implement both iOS and Android push without those services.  You'll need to set up your own external server and build the scripts to talk to both Apples and Googles push servers. I'm in the midst of trying to accomplish this with a new project.

 

You can stay up to date on the progress here http://goo.gl/uhqv7r

 

Cheers.



[TOPIC: post.html]
#31

gregr

[GLOBAL: userInfoPane.html]
gregr
  • Observer

  • 16 posts
  • Corona SDK

Noticed a recent Parse Blog post that mentions new support for GCM via their android SDK (i.e., no more backend app necessary).  I haven't tested functionality via their REST API yet, but might be promising for folks already using Parse:  http://blog.parse.com/2014/01/14/parse-push-adds-support-for-gcm/



[TOPIC: post.html]
#32

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

@gregr thats a great catch! Thanks for posting here. Can this be the great news we've all been waiting for? One push solution for both IOS & Android finally? 



[TOPIC: post.html]
#33

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

@gregr - Unless they have yet to update the REST API documentation, it still looks like you have to include the Parse API to generate the proper ID.  This just means that the push will now use the resources built into the Android OS instead of Parse's own baked-in solution, which was meant to cover devices like the Kindle, etc. that don't have GCM.  I'll dig a little further into it though.

 

Thanks for looking out.

 

Cheers.



[TOPIC: post.html]
#34

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

Hello,

 

I've posted a short piece on Tracking User Scores with the Parse Module for Corona SDK

 

Please share if you're so inclined.  Thanks for watching.

 

Cheers.



[TOPIC: post.html]
#35

scottshaw3d

[GLOBAL: userInfoPane.html]
scottshaw3d
  • Observer

  • 16 posts
  • Corona SDK

If I wanted to create a simple turn-based game with Corona, and use Parse's servers to save data for a cross-platform (iOS and Android) multiplayer, does your code/tutorials allow for this?

 

I watched your video on tracking users scores (very good btw), but will this work with an opponent(s) score also?

 

If not, then do you know if Parse allows for turn-based, cross-platform game?

 

Thanks



[TOPIC: post.html]
#36

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

This looks great! Thanks for the module. I am wondering if I could use this to enable/disable ads remotely? Would this be "easy" to do with Parse? Thanks again. Mo

[TOPIC: post.html]
#37

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

@scottshaw3d The mod_parse module provides the tools, so you'll still need to create the framework.  You would need to incorporate some cloud code to make it work best.  Since I prefer Lua over Javascript, as well as not being able to currently do Android push, I'm not sure if I will do a tutorial on that.

 

@Mo Would you be wanting to disable ads per user or globally?  Both are possible, but one requires a little more work than the other.

 

Cheers.



[TOPIC: post.html]
#38

scottshaw3d

[GLOBAL: userInfoPane.html]
scottshaw3d
  • Observer

  • 16 posts
  • Corona SDK

I followed the Avatar tutorial and keep receiving an error:

 

Runtime error: mod_parse.lua:348: type 'function' is not supported by JSON

 

The function in the mod_parse.lua that the error line is on is:

function Parse:buildRequestParams( withDataTable, masterKey )
  local postData = json.encode( withDataTable )

  return self:newRequestParams( postData, masterKey ) --for use in a network request

end

 

I printed the fileObjId and it comes out to a really long string:

dc21190f-f7a0-4979-9dc3-971c6cba525b-exImage.png

 

The Parse side saves the userID, username and the password but the avatar is still undefined.

I do have the image in the Resource Directory also.

 

Thanks for the quick response on the last comment btw.



[TOPIC: post.html]
#39

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

Thanks scottshaw3d, I'll take a look. You can file bug reports here as well: https://bitbucket.org/develephant/mod_parse/issues/new


Cheers.

[TOPIC: post.html]
#40

scottshaw3d

[GLOBAL: userInfoPane.html]
scottshaw3d
  • Observer

  • 16 posts
  • Corona SDK

Figured it out... Now you also need the fileObjURL in parse:linkFile.. not shown in the video.

 

fileObjId = event.response.name

fileObjURL = event.response.url

 

print( userObjId )

print( fileObjId )

print( fileObjURL )
       

local function onFileLinked( event )
    if not event.error then
         print( "Yeah" )
    end

end

parse:linkFile( parse.USER, userObjId, "avatar", fileObjId, fileObjURL, onFileLinked )



[TOPIC: post.html]
#41

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

@scottshaw3d Yes, that was just recently updated in the latest version.

 
I guess I need to update the video as well.  Thanks for pointing that out.  My apologies for the confusion.
 
Cheers.


[TOPIC: post.html]
#42

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

Thanks! It will be disable/enabling ads globally. Basically I want to be able to release paid apps with ads embedded (but turned off in the ad dashboard) Then later I want to set the app free (so to get a spike in DL) At that time, of course I will turn the ad ON (from the ad network dashboard) so people who downloaded the app for free are shown  ads. BUT of course in this case the people who paid for the app will be shown ad also which is a NO NO!

 

Not sure I make any sense!

 

Mo



[TOPIC: post.html]
#43

AppOwlDev

[GLOBAL: userInfoPane.html]
AppOwlDev
  • Contributor

  • 141 posts
  • Corona SDK

Hi, first off this module looks fantastic! I plan on trying it out once I'm done my current project.

 

When do you think you'll be doing a turn-based multiplayer tutorial?



[TOPIC: post.html]
#44

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

Hi spowell83,

 

The issue is no ability to enable push on Android via the Parse REST API at this time.  Without a persistent connection, we need to have an ability to ping the user.  A lazy poll is too expensive to run on an API that has a limit.  So, it's on hold for now.

 

Best.



[TOPIC: post.html]
#45

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

Can you please add userLogout method to your module?

 

Regards,

Damir.



[TOPIC: post.html]
#46

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

Hey Develephant...

 

Quick question on mod_parse that I hope you might be able to help with - also before I forget to say, excellent module.

 

I'm trying to save data to Parse upon the user exiting the app - however I fear that it's not completing before the app is closed.

 

I've debugged through the code and I just want to make sure where the actual request to Parse.com is made. I have noticed that my code gets through to Parse:updateObject() and ultimately Parse:sendRequest() - the latter of which I can see the network.request is stored in a table. Is the request made here, or is that table called later?

 

Unfortunately the callback from the request isn't made before the app is closed - and the Parse object doesn't appear to be updated. I'm presuming the network request isn't being made where I assume it to be, however I'm a little bit stumped on creating a workaround at the moment.

 

Any help would be appreciated...



[TOPIC: post.html]
#47

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

Hi SegaBoy,

 

Yes, the network request is made when it's entered into the table.  Once the request finalizes, the request id is searched for in the originating table, and then the callback is triggered.

 

I'm guessing that once the app starts to exit, the network calls are blocked?, though I don't know this for certain.

 

I assume you're attempting to save the data on an "applicationExit" system event? Let me know where you're calling it and I can take a look.

 

Cheers.



[TOPIC: post.html]
#48

SegaBoy

[GLOBAL: userInfoPane.html]
SegaBoy
  • Contributor

  • 635 posts
  • Corona SDK

Hey Develephant - yeah its on an applicationExit, I'm trying to save game state. I think your suggestion is probably correct, so might have to think of a different solution if that's the case.

 

I have a function in my GameController class, which is called upon applicationExit:

 

function Game:saveDataToParse()
    print("saveDataToParse")
    self.m_pMap:saveToParse()
    self.m_ItemManager:saveItems()
end

 

The interesting thing is that the call to saveItems (executed after the Parse call) is a save that does so to a local file, all of these save as expected - so I have two assumptions: it's either not making the network request in time, or as you've suspected then network calls have been disabled.

 

Ultimately I'm trying to replicate the functionality of games such as The Simpsons: Tapped Out, where game state is saved regardless of how the user exits the app.

 

Thanks again for looking into this for me...



[TOPIC: post.html]
#49

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,457 posts
  • Corona SDK

Hi SegaBoy,

 

Well oddly when just calling the module directly in the system event listener it's saving fine.

 

local function onSystemEvent( event )
  if event.type == "applicationExit" then
    parse:createObject( "State", { ["user"] = "Jimbo" } )
  elseif event.type == "applicationSuspend" then
    parse:createObject( "State", { ["user"] = "Timbo" } )
  end
end
Runtime:addEventListener( "system", onSystemEvent )

 

Perhaps there are too many "hops" to the Parse call and the event "tick" is closing before it gets there?

 

Seems strange....



[TOPIC: post.html]
#50

joel.eya

[GLOBAL: userInfoPane.html]
joel.eya
  • Observer

  • 5 posts
  • Corona SDK

Our team is new to Corona, just have a quick question we are getting the error below when we try to insert and get Objects, but we are able to insert. 

 

Super thanks in advance :)

 

 Runtime error

/Users/joeleya/Desktop/parse/mod_parse.lua:881: attempt to concatenate global 'err' (a table value)

stack traceback:

[C]: ?

/Users/joeleya/Desktop/parse/mod_parse.lua:881: in function 'onResponse'

/Users/joeleya/Desktop/parse/mod_parse.lua:772: in function </Users/joeleya/Desktop/parse/mod_parse.lua:772>

May 20 00:22:59.058: Runtime error

/Users/joeleya/Desktop/parse/mod_parse.lua:881: attempt to concatenate global 'err' (a table value)

stack traceback:

[C]: ?

/Users/joeleya/Desktop/parse/mod_parse.lua:881: in function 'onResponse'

/Users/joeleya/Desktop/parse/mod_parse.lua:772: in function </Users/joeleya/Desktop/parse/mod_parse.lua:772>




[topic_controls]
Page 2 of 4 1 2 3 4
 
[/topic_controls]