Skip to main content

Share

[Player Network SDK & MSDK]

Shares a message to the user's feed, such as a Facebook timeline. If the user is already logged in, the channel parameter can be left empty.

System channel supports sharing text, links, and images at the same time. For the System channel, the sharing screen provided by the OS is opened for the user to share the content to an installed app that has implemented the system share function.

Supported Platform

Supports Android, iOS, Windows platform.
note

MSDK currently does not support Windows.

Function Definition

void Share(GUAFriendReqInfo info, string channel = "");

Input Parameters

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

Callback Processing

The callback processing API is GUAFriendBaseResultObserver. The callback data structure is GUABaseResult.

The callback event is FriendBaseEvents. The callback methodID is GUA_FRIEND_SHARE.

Code Sample

See enumeration structure GUAFriendReqType.

(1) Share text, supports System

var reqInfo = new GUAFriendReqInfo
{
Type = FriendReqType.Friend_REQ_TEXT,
Description = "description"
};
UnionAdapterAPI.GetFriendService().Share(reqInfo);

(2) Share links, supports Facebook and System

var reqInfo = new GUAFriendReqInfo
{
Type = FriendReqType.Friend_REQ_LINK,
Link = "https://www.facebook.com/link"
};
UnionAdapterAPI.GetFriendService().Share(reqInfo);

(3) Share pictures, supports Facebook and System

var reqInfo = new GUAFriendReqInfo
{
Type = FriendReqType.Friend_REQ_IMAGE,
ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
};
UnionAdapterAPI.GetFriendService().Share(reqInfo);

(4) Share text, link, and image simultaneously, supports System

var reqInfo = new GUAFriendReqInfo
{
Type = FriendReqType.Friend_REQ_IMAGE,
Description = "INTL Description",
Link = "https://www.facebook.com/link",
ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
};
UnionAdapterAPI.GetFriendService().Share(reqInfo);

(5) Share videos, supports Facebook

var reqInfo = new GUAFriendReqInfo
{
Type = FriendReqType.Friend_REQ_VIDEO,
MediaPath = "/path/to/video"
};
UnionAdapterAPI.GetFriendService().Share(reqInfo);