SendMessage
AndroidiOSWindows
If you were looking for the method for use with Unity, see SendMessage for Unity SDK.
If you were looking for the method for use with Unity, see SendMessage for Unity SDK.
Sends a message to a particular friend. If the user is already logged in, the channel parameter can be left empty.
Function definition
UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static bool SendMessage(const FINTLFriendReqInfo Info, const FString Channel="");
Input parameters
Parameter | Type | Description |
---|---|---|
Info | FINTLFriendReqInfo | Friend module request body Including the request object, request information, and other important parameters. |
Channel | FString | Channel definition Example: "Facebook" |
Return value
The callback methodID is kMethodIDAuthLaunchAccountUI
.
Observers
The callback processing interface is FriendBaseResultObserver. The callback data structure is BaseResult.
The callback methodID is kMethodIDFriendSendMessage
.
Code sample
For more information on supported channels, see Friend Direct Message.
(1) Send text
FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqText;
reqInfo.Description = "INTL Service";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "QQ");
(2) Send links
FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqLink;
reqInfo.Link = "https://www.facebook.com";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "Facebook");
(3) Send pictures
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 invitations
FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqInvite;
reqInfo.Link = "https://www.facebook.com/link";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "Facebook");
(5) Send videos
FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqVideo;
reqInfo.MediaPath = "path/to/video";
bool support = UINTLSDKAPI::SendMessage(reqInfo, "QQ");