0
votes

I'm new to using Parse.com and I'm trying to understand the general relationship between a logged in user and user-specific data.

I've figured out and understand how to create users and objects but I'm fuzzy on how to connect the two.

  • Is it as simple as creating a user and then once their logged in, storing an object with their username as the key?

  • Then when a user signs in successfully, you retrieve the object under their username key?

I just want to make sure I'm approaching this from the right angle, since I plan on having a lot of users and I also want the most secure approach.

I've read through the Parse.com documentation but can't seem to find the connection between the two. Any help is appreciated!

2
Can you add brief details about your environment/platform or SDK? Parse details differ a little bit between platforms.piojo
@piojo This is for an iOS application on iPhone, using Swift.brustj

2 Answers

0
votes

Do you mean when the user submits any details it is recorded with their User ID? If so, then this code will work for you:

 ParseUser user = ParseUser.getCurrentUser();
 //yourObjectID.put("User", user);
0
votes

There is no user-specific data (all data is global with respect to the app ID you registered, as Parse is a database), but you can store data inside a ParseUser object. You can also give it access controls (an ACL), so only that user can read/write it. When the user signs in successfully, I don't believe it will be part of the ParseUser object yet, you need to fetch the data. (This is definitely true for object fields, but I'm not sure about simple fields like strings and ints. It deserves testing.)

There is a caveat to this. Depending on which SDK you're using, some of that information may be cached. In Unity 3D, for instance, the ParseUser object will retain all its data between program invocations (and indeed, will remain logged in).