Share (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
| Parameters | Type | Explanation |
|---|---|---|
| Info | FINTLFriendReqInfo | Friend module's request structure Contains key input parameters like request object and request information |
| Channel | FString | Channel 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 variables | Type | Description | Remarks |
|---|---|---|---|
| Type | int32 | Friend request type (UINTLFriendReqType) | Required for sharing messages, not required for adding friends. |
| User | FString | The user, can be ID or OpenID | Mandatory |
| Title | FString | The title of the share | Mandatory |
| Description | FString | Briefly describe the purpose of sharing | Optional |
| ImagePath | FString | Image, can be a local path or URL, local path preferred | Optional |
| ThumbPath | FString | Thumbnail, usually the game's icon, can be local or URL link, local path preferred | Optional |
| MediaPath | FString | Multimedia (music or video), local path only supported | Optional |
| Link | FString | Sharing link, can be for image, music, video or redirect links etc. | Optional |
| ExtraJson | FString | Extended field | Optional |