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

Custom ParseUser example needed #2

Closed
fcduarte opened this issue Jul 8, 2014 · 3 comments
Closed

Custom ParseUser example needed #2

fcduarte opened this issue Jul 8, 2014 · 3 comments

Comments

@fcduarte
Copy link

fcduarte commented Jul 8, 2014

Hi,

could you please provide an example on how to extend ParseSignupFragment for adding a custom user, for instance, public class CustomUser extends ParseUser, to the server.

Thanks!

@stanleyw
Copy link
Contributor

stanleyw commented Jul 8, 2014

What are you doing that requires subclassing ParseUser? We do have Android docs for subclassing ParseObjects, but you don't need to for saving additional fields on ParseUser.

[EDITED] Previously I said here that subclassing ParseUser has limitations. Actually, subclassing ParseUser should work fine, but I'd still not recommended it unless you really need to.

@fcduarte
Copy link
Author

fcduarte commented Jul 8, 2014

I have a new field called phoneNumber .. I want to add that field on sign up screen .. My biggest problem is with this line from the docs:

You can add additional input fields in the signup form here. If you do, you also need add code to ParseSignupFragment to copy that data into the ParseUser object

There isn't any ParseSignupFragment example on how to do it.

Thanks,

@stanleyw
Copy link
Contributor

stanleyw commented Jul 8, 2014

Thanks for this feedback. You don't have to subclass ParseUser to achieve this. You just have to add logic to ParseSignupFragment to retrieve the text from your phone number input EditText element, and write it to a phoneNumber field on the ParseUser object.

Please take a look at how the name field is saved onto the ParseUser object. The name field implementation is actually supposed to be the example of how to add a custom field onto a ParseUser; it's not one of the default provided fields.

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

No branches or pull requests

2 participants