Skip to main content

Add Friend (AddFriend) [MSDK only]

[MSDK Only] Players can directly add (invoke QQ) other game players as QQ friends in-game. (Multiple clicks will not send multiple QQ friend requests).Currently only QQ supports this feature.

Supported platforms

Supports Android, iOS platform.

Function Definition

void AddFriend(GUAFriendReqInfo info,  string channel = "");

Input Parameters

ParametersTypeDescription
DescriptionFriend request (GUAFriendReqInfo)Friend Module Request Structure
Mainly includes the request object, request information, and other important input parameters
channelstringChannel information
For example, "QQ"

Callback Handling

The callback handling interface is GUAFriendBaseResultObserver.The callback data structure is GUABaseResult.

The callback event is FriendBaseEvents. The callback ID is GUA_FRIEND_ADD_FRIEND.

Code Example

var reqInfo = new GUAFriendReqInfo
{
Title = "title", // Optional when adding a friend, indicates notes
Desc = "desc", // Optional when adding a friend, indicates verification information
Type = GUAFriendReqType.Friend_REQ_TEXT, // Optional when adding a friend
User = "friendOpenId", // Required when adding a friend, the friend openid
};
UnionAdapterAPI.GetFriendService().AddFriend(reqInfo, "QQ");