Skip to main content

AddFriend [MSDK Only]

[MSDK Only] Players can directly add their game friends as their QQ friends as games can directly open mobile QQ. Multiple clicks will not send multiple QQ requests. Currently only supports QQ.

Supported Platform​

Supports Android, iOS platform.

Function Definition​

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

Input Parameters​

ParameterTypeDescription
infoGUAFriendReqInfoFriend module request body
Including the request object, request information, and other important parameters.
channelstringChannel
For example, QQ.

Callback Processing​

The callback processing API is GUAFriendBaseResultObserver. The callback data structure is GUABaseResult.

The callback event is FriendBaseEvents. The callback methodID is GUA_FRIEND_ADD_FRIEND.

Code Sample​

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