Skip to main content

SendMessage

AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see SendMessage for Unreal Engine SDK.

Sends a message to a particular friend. If the user is already logged in, the channel parameter can be left empty.

Function definition

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

Input parameters

ParameterTypeDescription
infoINTLFriendReqInfoFriend module request body
Including the request object, request information, and other important parameters.
channelstringChannel definition
Example: "Facebook"

Return value

No return value.

Observers

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

The callback methodID is INTL_FRIEND_SEND_MESSAGE.

Code sample

For more information on supported channels, see Friend Direct Message.

(1) Send text

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

(2) Send links

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

(3) Send pictures

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 invitations

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

(5) Send videos

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