Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Parse
Started by Michael W. Nov 24 2015 01:20 PM

71 replies to this topic
release android ios tvos windows os x lua
[TOPIC CONTROLS]
Page 3 of 3 1 2 3
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

Updated Release 0.2.7

 

This version adds support for the Parse-Server standalone open source framework.

 

Added cloudAddress to Config module

Added generateInstallationId to Tools module

 

Updated docs to clarify Parse-Server module support

 

Enjoy.



[TOPIC: post.html]
#52

Chribbe

[GLOBAL: userInfoPane.html]
Chribbe
  • Enthusiast

  • 73 posts
  • Corona SDK

Thank you @develephant. That was quick!


  • Develephant likes this

[TOPIC: post.html]
#53

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 232 posts
  • Corona SDK

I having a issue with Parse regarding user passwords. I can't find anything on restrictions or requirements, but noticed that in the curl examples you can't have = or @ in them http://curl.haxx.se/docs/manpage.html#--data-urlencode

 

I was wondering if the plugin itself had any such restrictions? If I create a user with the password: ================================================== I get an Invalid Login Parameters error when I try to login.



[TOPIC: post.html]
#54

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

Hi @tap32

 

A couple questions.

 

Have you tested a password that is 32 chars or less?

 

Are you using the Corona Parse plugin?

 

Cheers 



[TOPIC: post.html]
#55

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 232 posts
  • Corona SDK

Hi @develephant, thanks for getting back. Am using your plugin "com.develephant" publisherId. 

 

I've not played around with the password length. As I couldn't see any mention of enforced restrictions, and as there were no errors at account creation, my suspicions were immediately that there was a character or two at fault.

 

I'm using the app as part of a study (which I hope to have finished before Parse shutsdown. The participants get no choice in the password, but the app generates one for them and stores it locally as we don't need them to reuse the accounts. 

 

I use the following code to generate the password. I use an array rather than a random in just to make filtering characters easier.

 

 
local chars={[[ ]],[[!]],[[#]],[[$]],[[%]],[[&]],[[(]],[[)]],[[*]],[[+]],[[-]],[[.]],[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[7]],[[8]],[[9]],[[:]],[[;]],[[<]],[[>]],[[?]],[[A]],[[B]],[[C]],[[D]],[[E]],[[F]],[[G]],[[H]],[[I]],[[J]],[[K]],[[L]],[[M]],[[N]],[[O]],[[P]],[[Q]],[[R]],[[S]],[[T]],[[U]],[[V]],[[W]],[[X]],[[Y]],[[Z]],[[[]],[[^]],[[_]],[[`]],[[a]],[[b]],[[c]],[[d]],[[e]],[[f]],[[g]],[[h]],[[i]],[[j]],[[k]],[[l]],[[m]],[[n]],[[o]],[[p]],[[q]],[[r]],[[s]],[[t]],[[u]],[[v]],[[w]],[[x]],[[y]],[[z]],[[{]],[[|]],[[}]]}
function generatePassword()
  math.randomseed(os.time()+system.getTimer())
  local password={}
  for i=1, 50 do 
    password[i]=chars[math.random(#chars)]
  end
 
  return table.concat(password,"")
end

 

You'll notice I've not removed the = and @ symbols from the options. I'd noticed that generally some accounts work and some don't. All have the same password recipe. Account creation always went fine, but when they opened the app after it had been closed and it attempts to login there were issues. The account with issues seemed to have = in their passwords, and generating a password just of = caused the same issue. 



[TOPIC: post.html]
#56

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

Hi,

 

I would recommend "parse.tools.generateInstallationId( input_seed )" to gain access to a Parse compatible ID.

 

http://parse.develephant.com/Tools/#generateinstallationid

 

Here is the full method, if you want to use it elsewhere:

 

function tools.generateInstallationId( input )
  assert(input, "An input string is a required parameter.")
 
  local crypto = require( "crypto" )
  local hash = crypto.digest( crypto.md5, input )
  local function h( s, e )
    return string.sub(hash, s, e)
  end
  local id = h(1,8)..'-'..h(9,12)..'-'..h(13,16)..'-'..h(17,20)..'-'..h(21,nil)
  return id
end

 

Hope that helps.

 

Cheers.



[TOPIC: post.html]
#57

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 232 posts
  • Corona SDK

Fantastic, will try that instead



[TOPIC: post.html]
#58

pirx

[GLOBAL: userInfoPane.html]
pirx
  • Enthusiast

  • 88 posts
  • Corona SDK

Hi. Great plugin! I'm currently building an app around it, however I have a question.

Is it possible to utilize Parse key filters other than WHERE and the macros? Specifically I would like to get objects using the "containedIn" query (as in get all objects whose objectId is contained within the passed table).  I could make a Cloud function to do that but is there an out-of-the-box way?



[TOPIC: post.html]
#59

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

Hi,

 

The "where" entry should have probably been called "query" but...

 

To answer your question, yes you can add any of the query operators in the "where" entry. The "hard" part is converting your query properly from Parse-land.

 

Example:

 

:where( { score = { ["$gt"] = 200 } } )

 

If you need more help let me know.

 

Cheers.



[TOPIC: post.html]
#60

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

You also might look at:

 

http://parse.develephant.com/CH3_Usage/

 

Cheers.



[TOPIC: post.html]
#61

rune7

[GLOBAL: userInfoPane.html]
rune7
  • Contributor

  • 362 posts
  • Corona SDK

Hi,

 

I'm getting an error when I try to login to parse using twitter account auth data. The registration phase went OK, but the plug-in seems to have an issue with the callback during a subsequent login attempt. This is the code used:

    parse.request( parse.User.login )
    :options( params )
    :response(cb)

Where params contain the twitter auth data. I get an error:

 
ERROR: Runtime error
16:40:37.353  ?:0: attempt to concatenate a table value
16:40:37.353  stack traceback:
16:40:37.353   ?: in function 'response'
16:40:37.353   C:\Dev\Mobile\Projects\Dare\src\parseInteg.lua:109: in function 'userLoginImp'
16:40:37.353   C:\Dev\Mobile\Projects\Dare\src\parseInteg.lua:123: in function 'userLoginWithTwitter'
 

If I remove the response line (the last line from the code above), than the error does not show, but I have no way of processing the response. Also the debug info is not writing anything when this line is removed, so I can't really know if a response was ever received.

 

If I use a regular register (mail+pass) than all goes well using the same code. Both registration and subsequent logins are going as expected. Perhaps there is some glitch in the code that processes the response from the server when it contains some nested tables?

 

Appreciate your help.

 

Regards,

Adi



[TOPIC: post.html]
#62

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

Hi,

 

Parse is currently unsupported so I'm not sure how much I can help. I don't have a Parse instance running.

 

What happens if you do this:

 

local req = parse.request( parse.User.login )

req:options( params )

req:response( cb )



[TOPIC: post.html]
#63

rune7

[GLOBAL: userInfoPane.html]
rune7
  • Contributor

  • 362 posts
  • Corona SDK

Hi, It returns the same error.

Parse stand alone is here to stay. Probably will become the most common small scale remote DB solution now that its open. What alternatives will you use for server side?

Is the plug-in pure Lua or based on enterprise?



[TOPIC: post.html]
#64

Develephant

[GLOBAL: userInfoPane.html]
Develephant
  • Corona Geek

  • 1,450 posts
  • Corona SDK

To clarify, the Corona Parse module is not being supported. Its available in the repo (I think) for anyone to hack on.

 

My priority is Corona Cloud. And remember that the Lua cloud code is a major aspect of Coronium/Corona Cloud. You won't get this is Parse open source, nor is there any UI/front-end (last I checked).

 

We had discussed taking in Parse server, but it limits our abilities to grow the Corona Cloud feature-set over the future.



[TOPIC: post.html]
#65

Appduction Studios

[GLOBAL: userInfoPane.html]
Appduction Studios
  • Enthusiast

  • 36 posts
  • Corona SDK

Hi Chris,

We've been using the Parse Plugin plugin for a while, and after the news of Parse shutting down, we've migrated to Parse Server hosted on Digital Ocean. However, we can't seem to get any queries to run, we keep getting:
 

{"error":"Invalid paramater for query: include=sponsor,sub_categories,sub_categories.sponsor","code":102}

To be specific, this error does not occur when I don't pass "options" in the call. Even when doing a simple user sign in such as the one in the following example:
 

parse.request(parse.User.login)
:options({username="Chris", password="1234abcd"})
:response(cb)

The call fails with error 200, missing username. So it seems like the options aren't being passed or encoded correctly. I think it's also important to note that this error does not occur when using mod_parse.

 

So to get things straight, are you saying the Parse Plugin will no longer be supported hence it will not work with Parse Server? Or is this just a bug?

Best,
Shehab



[TOPIC: post.html]
#66

Appduction Studios

[GLOBAL: userInfoPane.html]
Appduction Studios
  • Enthusiast

  • 36 posts
  • Corona SDK

Hey guys, does anyone have any input on this yet?



[TOPIC: post.html]
#67

david.smith0143

[GLOBAL: userInfoPane.html]
david.smith0143
  • Observer

  • 1 posts
  • Corona SDK

Parse is shutting down, so we need more plug-in which should be used to transfer parse to any other back-end,



[TOPIC: post.html]
#68

Appduction Studios

[GLOBAL: userInfoPane.html]
Appduction Studios
  • Enthusiast

  • 36 posts
  • Corona SDK

Hi David,
 

The Parse Plugin itself is only an interface with your Parse or Parse Server app. It has nothing to do with migrating any existing apps you might have.

However, we (Appduction) have addressed the possible scenarios for migrating from Parse to Parse Server in this blog post. In addition, we have also created this script, which migrates your existing Parse app to a Parse Server with Dashboard on DigitalOcean.

 

Can anyone in the Corona staff give us an update on the status of the Parse Plugin though? If we're doing anything wrong from our side, we'd like to know, and if it's a bug, then an estimate of when it can be addressed would highly be appreciated. We don't want to revert to mod_parse only to revert back a bit later.

 

Best,

Shehab



[TOPIC: post.html]
#69

rune7

[GLOBAL: userInfoPane.html]
rune7
  • Contributor

  • 362 posts
  • Corona SDK

Hi Shehab, 

 

Do you think this script will work on other ubunto installations? we are usually working with openshift and I know they have a cartridge for parse but unfortunately we weren't able to make it work. I thought maybe using your script we can make it work. I have zero know how in unix & scripting.



[TOPIC: post.html]
#70

Appduction Studios

[GLOBAL: userInfoPane.html]
Appduction Studios
  • Enthusiast

  • 36 posts
  • Corona SDK

Hi Rune,

Unfortunately, the script is written for Ubuntu 14.04. It might work on other Ubuntu versions with tweaking. But major changes would be required to get it to run on a completetly different Linux distribution.



[TOPIC: post.html]
#71

petrsvar

[GLOBAL: userInfoPane.html]
petrsvar
  • Enthusiast

  • 53 posts
  • Corona SDK

I have the exactly same problem with login (code: 200, error: username is required) with parse.User.login. 

My code: 

 appData.parse.request( appData.parse.User.login )
  :options( { username="Chris", password="1234abcd" } )
  :response(cb)

Any hint, anyone, please?


[TOPIC: post.html]
#72

ashokry

[GLOBAL: userInfoPane.html]
ashokry
  • Observer

  • 22 posts
  • Corona SDK

Hi,

I am getting an error when using Parse login() function

 

parse.request( parse.User.login )

  :options( { email = 'ashraf@shokry.net', password = 'aa' } )
  :response(cb)
 
the error is always (username/email is required)
I am using back4app backend
 
Thank you



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

Also tagged with one or more of these keywords: release, android, ios, tvos, windows, os x, lua