Skip to main content

Send message to specified friend (SendMessage)

AndroidiOSPC

If you are using Unreal Engine, please refer to SendMessage in the Unreal Engine SDK.

Send message to the specified friend. If already logged in, channel input parameters can be left blank.

Function definition​

public static void SendMessage(INTLFriendReqInfo info, string channel = "");

Parameter Instructions​

ParametersTypeExplanation
infoINTLFriendReqInfoFriend module request structure
Mainly contains the request object, request information, and other essential input parameters.
channelstringChannel information
Such as "Facebook"

Return Value​

No return value.

Callback processing​

The callback handling interface is FriendBaseResultObserver.The callback data structure is BaseResult.

Callback ID is INTL_FRIEND_SEND_MESSAGE.

Code example​

For more information about supported channels, see Direct Message with Friends.

(1) Send Text

var reqInfo = new INTLFriendReqInfo
{
Type = FriendReqType.Friend_REQ_TEXT,
Description = "INTL Service"
};
INTLAPI.SendMessage (reqInfo, INTLChannel.QQ);

(2) Send Link

var reqInfo = new INTLFriendReqInfo
{
Type = FriendReqType.Friend_REQ_LINK,
Link = "https://www.facebook.com/link"
};
INTLAPI.SendMessage (reqInfo, INTLChannel.Facebook);

(3) Send Image

var reqInfo = new INTLFriendReqInfo
{
Type = FriendReqType.Friend_REQ_IMAGE,
ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
};
INTLAPI.SendMessage(reqInfo, INTLChannel.QQ);

(4) Send Invitation

var reqInfo = new INTLFriendReqInfo
{
Type = FriendReqType.Friend_REQ_INVITE,
Link = "https://www.facebook.com/link";
};
INTLAPI.SendMessage (reqInfo, INTLChannel.Facebook);

(5) Send Video

var reqInfo = new INTLFriendReqInfo
{
Type = FriendReqType.Friend_REQ_VIDEO,
MediaPath = "/path/to/video"
};
INTLAPI.SendMessage (reqInfo, INTLChannel.QQ);