Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix User objects not saving, Add support for Parse Files, Anonymous Login #67

Merged
merged 3 commits into from Feb 5, 2019

Conversation

klanmiko
Copy link
Contributor

@klanmiko klanmiko commented Feb 2, 2019

Hi Phil,

I am using your sdk to develop an application for our hackathon participants. I ran over a few issues that I fixed and I thought it woud be a good idea to contribute back to this project. Here are my changes:

  • Fixed changes on User object not syncing to server due to missing session token when accessing API
  • Added the ability to login anonymously by providing "AUTH_DATA" POST data with a unique UUID. Can be extended to allow for facebook and twitter auth in the future
  • Added the ability to create a Parse file with a url and name and download the file to temporary storage
  • Fixed bug with ParseFile initialized to null _file value.

Let me know if these need work

@klanmiko
Copy link
Contributor Author

klanmiko commented Feb 2, 2019

helps with #36

@RodrigoSMarques
Copy link
Contributor

Very Good: login anonymously

@ghost
Copy link

ghost commented Feb 4, 2019

Hi @klanmiko, are you sure parse files works ?

Because I tested with a new "picture" column with png file.

And when I print the payload, I have this sample:

"picture":"{\"__type\": \"Pointer\", \"className\": \"File\", \"objectId\": \"null\"}"}

@phillwiggins phillwiggins merged commit 970011c into parse-community:master Feb 5, 2019
@phillwiggins
Copy link
Member

Amazing work.

I'm happy to merge and will test tonight to ensure the file upload is working correctly.

Thanks!

@klanmiko
Copy link
Contributor Author

klanmiko commented Feb 5, 2019

Thanks @phillwiggins! Thanks for making this library.

@scaneat yes it works. The reason you see that is because the parse_encoder.dart encodes the object as a pointer and not a file. I think it is done this way for a specific reason...? to send to the server? Otherwise the print statements for the ParseUser and ParseFile, ParseGeo should be before that

@ghost
Copy link

ghost commented Feb 6, 2019

Edit: Nice, reading Parse Files works!

@RodrigoSMarques
Copy link
Contributor

Hi Guys,
Have you checked the ParseFile upload is working?
Do you have any sample code to send me?

@phranck
Copy link

phranck commented Apr 12, 2019

@klanmiko You added support for anon login, which is great! 😊 However, I wonder how to check if the currentUser is an anonymous user? Do you have a suggestion?

Thanks in advance!

@danibjor
Copy link

danibjor commented Apr 12, 2019

@phranck you can check if

var user = await ParseUser.currentUser();
if (user != null && user.get<Map<String, dynamic>>('userData') != null && user.get<Map<String, dynamic>>('userData')['anonymous'] != null) { 
  // do anonymous user stuff
}

Edit: you have to use user.get<>() wait to get the userData object.

fischerscode pushed a commit to fischerscode/Parse-SDK-Flutter that referenced this pull request Sep 5, 2020
Fix User objects not saving, Add support for Parse Files, Anonymous Login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants