Hello.
Once I've sent a contact request like this:
CombuManager.localUser.AddContact(addFriendField.text, eContactType.Request, (success, error) => {
if (success){
UpdateFriendColumns();
} else {
Debug.LogError("Add Friend error: " + error);
}
});
... where should I look for the request after logging in with the other player (the one who the first player wants to make their friend)?
You can load the different contact type (request, friend, ignored) with User.LoadFriends and if it returns true in the callback then you can access the data with localUser.friends
In the next update you will have different arrays for friends, ignored and requests that are all set by LoadFriends based on the contact type requested, so you can call all of them in sequence and have all 3 contacts (though it's ever a good practice to implement a queue for requests instead of making 3 calls at time).
FRANCESCO CROCETTI @ SKARED CREATIONS
Thanks for the response!
So, if I call for requests and after that I call for friends or ignored, will the list be replaced? Or will it then be a mix of different entries without any way to tell them apart? If the latter, can I somehow unload the previous list? What if I want to show the player the friends list and ignore list at the same time? Should I keep my own lists instead of relying on the localUser.friends? (There seems to be an "isFriend" variable in the IUserProfile class so I suppose that helps.)
Maybe I just don't quite grasp the good practice you describe. It seems to me the improvement you mention for the next update would make this a lot more convenient to work with.
For now it replaces the friends list with the latest called, so you need to maintain your own lists if you need all 3 at the same time. With next update it will replace their own separated lists friends, ignored and requests.
FRANCESCO CROCETTI @ SKARED CREATIONS
OK. Then how do I accept or refuse a friend request? Do they vanish from the list when I do?
To accept a request you call AddContact passing eContactType.Friend (of course from the user who received the request).
To decline a request you call AddContact passing eContactType.Ignore, the player's contact will be deleted from the other but the other still exists in the local user contacts as ignored. If you want to completely delete the request then you can call directly RemoveContact.
I will explain better the whole process in the documentation as soon as possible.
FRANCESCO CROCETTI @ SKARED CREATIONS
Hello again,
Just a little feedback: The error message when you try to send a friend request to someone you've already sent a request to (or are already friends with) is very vague: "An error occurred".