Skip to main content

Share (Share)

AndroidiOSWindows
If you are using the Unity engine, please refer to Unity SDK's Share.

Send messages to the information wall, such as Facebook, without needing to fill in channel input parameters when already logged in.

When the channel is System, the system share menu will open, allowing users to choose to share content with the corresponding APP, provided the APP supports system sharing.When the channel is System, you can share text, links, and images simultaneously.

Function Definition

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

Input Parameters

ParametersTypeExplanation
InfoFINTLFriendReqInfoFriend module's request structure
Contains key input parameters like request object and request information
ChannelFStringChannel information
Such as "Facebook"

Return Value

Callback ID is kMethodIDAuthLaunchAccountUI.

Observers

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

Callback ID is kMethodIDFriendShare.

Code Sample

For more information about supported channels, see Friend Share Content.

(1) Share text

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

(2) Share link

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

(3) Share 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::Share(reqInfo, "Facebook");

(4) Share text, link, and image

FINTLFriendReqInfo reqInfo;
reqInfo.Type = (int32)UINTLFriendReqType::kReqImage;
reqInfo.Description = "INTL Service";
reqInfo.Link = "https://www.facebook.com/link";
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
UINTLSDKAPI::Share(reqInfo, "System");

(5) Share video

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

Data Structure

UINTLFriendReqType: Friend request type

UENUM(BlueprintType)
enum class UINTLFriendReqType :uint8 {
kReqText = 0 UMETA(DisplayName = "TEXT"),
kReqLink = 1 UMETA(DisplayName = "LINK"),
kReqImage = 2 UMETA(DisplayName = "IMAGE"),
kReqInvite = 3 UMETA(DisplayName = "INVITE"),
kReqVideo = 4 UMETA(DisplayName = "VIDEO")
};

FINTLFriendReqInfo: Friend information

Member variablesTypeDescriptionRemarks
Typeint32Friend request type (UINTLFriendReqType)Required for sharing messages, not required for adding friends.
UserFStringThe user, can be ID or OpenIDMandatory
TitleFStringThe title of the shareMandatory
DescriptionFStringBriefly describe the purpose of sharingOptional
ImagePathFStringImage, can be a local path or URL, local path preferredOptional
ThumbPathFStringThumbnail, usually the game's icon, can be local or URL link, local path preferredOptional
MediaPathFStringMultimedia (music or video), local path only supportedOptional
LinkFStringSharing link, can be for image, music, video or redirect links etc.Optional
ExtraJsonFStringExtended fieldOptional