Combu  2.1.14
Unity API Documentation
Managing Contacts

Table of Contents

In this section you will learn how to retrieve the contacts lists of the local user and how to add/remove users to the friends/ignore lists.

Loading Contacts

To retrieve the list of contacts from the local user you need to call the LoadFriends method on CombuManager.localUser:

CombuManager.localUser.LoadFriends( eContactType.Friend, (bool success) => {
if (success)
Debug.Log("Success: " + CombuManager.localUser.friends.Length);
else
Debug.Log("Failed");
});

Adding Contacts

To add another user to a contact list of the local user you need to call AddContact:

// Add by User/Profile object
CombuManager.localUser.AddContact(otherUser, eContactType.Friend, (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});
// Add by username
CombuManager.localUser.AddContact("username", eContactType.Friend, (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});

Removing Contacts

To remove a user from the contact lists of the local user you need to call RemoveContact:

// Remove by User/Profile object
CombuManager.localUser.RemoveContact(otherUser, (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});
// Remove by username
CombuManager.localUser.RemoveContact("username", (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});