Benjamin Porter
Benjamin Porter

Reputation: 447

Parse.com Friend Relations

I am developing an iOS app that will help people find roommates at the university they attend. I had planned on kind of doing it similar to tinder where you swipe left or right on someone and then if both users swipe right you can start talking. But I am not sure how I would do that in parse because I currently only have one class that holds users and their information. Could anyone possibly help me understand how I would go about do this? Or is there possibly a better way than making both users swipe right to start talking?

Upvotes: 1

Views: 61

Answers (1)

Adam Kaump
Adam Kaump

Reputation: 735

I would suggest creating two new tables to capture swipe interactions. Something like:

Liked
- initiatingUser
- likedUser

Unliked
- initiatingUser
- unlikedUser

And then every time a user swipes right or left, add a new record to the proper table.

Then I would use the AfterSave functionality of Cloud Code to perform a fetch of the Liked table where the initiatingUser and likedUser are flipped. I could then send a push notification to the proper user, create a new record in a new table that both users will see the next time they log in - something along those lines.

Upvotes: 2

Related Questions