Skip to main content

Send message to specified friend (SendMessage)

AndroidiOSWindows
If you are using the Unity engine, see Unity SDK's SendMessage.

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

Function Definition

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static bool SendMessage(const FINTLFriendReqInfo Info, const FString Channel="");

Parameter Instructions

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

Return Value

Callback ID is kMethodIDAuthLaunchAccountUI.

Callback processing

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

Callback ID is kMethodIDFriendSendMessage.

Code example

For more information on supported channels, see Direct Message to Friends.

(1) Send Text

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqText;
reqInfo.Description = "INTL Service";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "QQ");

(2) Send Link

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqLink;
reqInfo.Link = "https://www.facebook.com";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "Facebook");

(3) Send Image

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqImage;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "QQ");

(4) Send Invitation

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqInvite;
reqInfo.Link = "https://www.facebook.com/link";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "Facebook");

(5) Send Video

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqVideo;
reqInfo.MediaPath = "path/to/video";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "QQ");