Skip to main content

GUAQuereyFriendObserver

[MSDK & Player Network SDK] Register the callback of the friend module, the game needs to process the callback function. For more information on the callback data structure, see GUAFriendResult.

note

It is strongly recommended to perform registration in the startup function of the game application.

Function Definition

The list of methods used to process the callback events.

Callback EventCommon[Player Network SDK Only][MSDK Only]
FriendBaseEventsQueryFriends--
event OnResultHandler<GUAFriendResult> QuereyFriendEvents;

Code Sample

// Add callbacks
UnionAdapterAPI.GetFriendService().QuereyFriendEvents += OnFriendQueryFriend;

// Remove callbacks
UnionAdapterAPI.GetFriendService().QuereyFriendEvents -= OnFriendQueryFriend;

// QuereyFriendEvents callback
private void OnFriendQueryFriend(GUAFriendResult friendRet)
{
string methodTag = "";
if (friendRet.MethodId == (int)GUAMethodID.GUA_FRIEND_QUERY_FRIENDS)
{
methodTag = "QueryFriends";
}
Debug.Log(methodTag + friendRet.ToString());
}