Right now the "Friend" component in my app lists every user that has signed up for the app. User A can then add as many friends as they want and interact with them.
What I want to do is allow User A to send a request to those users so that User B, User C, etc. can either accept or deny the request to interact with User A.
Has anyone successfully accomplished this?
Any tips / advice / tutorial on how to approach this?
Thank you!
EDIT:
Here is what I have tried.
I have a new class called Friendship that contains:
toUser - points to the User class
fromUser - points to the User class
status - string
PFQuery * query = [PFQuery queryWithClassName:@"Friendship"];
[query whereKey:@"toUser" equalTo:[PFUser currentUser]];
[query whereKey@"status" equalTo:@"pending"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (error)
{
//NSLog error
}
else {
self.followingArray = objects;
[self.myTableView reloadData];
}
Objects is not returning anything.