Skip to main content

Sharing on iOS

Sharing on iOS is implemented by calling the methods SendMessage or Share with a FriendReqInfo data structure, for Unity SDK or Unreal Engine SDK.

For more information on callbacks, see Callbacks.

Facebook

note

Since June 10, 2019, the Share to Messenger SDK is no longer available for new app integrations. However, existing projects can still use the SendMessage method to share links to Messenger.

As new submissions are no longer accepted for the Web Games on Facebook and Facebook Gameroom platforms, Player Network SDK has discontinued support for sending invites with the SendMessage method.

Facebook supports the following sharing modes:

  • Sharing to Messenger: For sharing to Facebook Messenger.
  • Sharing to Feed: For sharing to Facebook timeline.
  • Sharing for Gaming: Specifically for gaming services, games are required to enable Login for Gaming to use this feature.

The following content can be shared to Facebook using SendMessage and Share:

  • SendMessage: Link, for sharing to Messenger.
  • Share: Link, for sharing to Feed.
  • Share: Image, for sharing to Feed and sharing for Gaming.
  • Share: Video, for sharing to Feed.
note

Since Facebook SDK V4.22.0, the Title, Description, Caption and ImagePath fields are no longer supported when sharing links.

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the Messenger app on their device.

Parameters:

  • Type
  • Link: URL
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.facebook.com/link";
INTLAPI.SendMessage(reqInfo, INTLChannel.Facebook);
Image: Facebook send link

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • Link: URL
  • ExtraJson (Optional) - hashtag
    • Each hashtag entered as "#value", only the first "#" will be highlighted.
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.facebook.com/link";
reqInfo.ExtraJson = "{\"hashtag \":\"#value\"}";
INTLAPI.Share(reqInfo, INTLChannel.Facebook);
Image: Facebook share link

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • ImagePath: Image file path, either the path of a local image file or an online URL.
    • Image cannot exceed 12MB.
    • Online images will not be downloaded to local storage.
  • ExtraJson (Optional) - hashtag
    • Each hashtag entered as "#value", only the first "#" will be highlighted.

For sharing for Gaming, add the \"mode\":1 property to ExtraJson. Hashtags cannot be added when sharing in this mode.

var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
reqInfo.ExtraJson = "{\"hashtag \":\"#value\"}";
INTLAPI.Share(reqInfo, INTLChannel.Facebook);

Sharing to Feed:
Image: Facebook Classic mode

Sharing for Gaming:
Image: Sharing for Gaming

Share: Video

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_VIDEO.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • MediaPath: Video file path, video cannot exceed 50MB.
  • ExtraJson (Optional) - hashtag
    • Each hashtag entered as "#value", only the first "#" will be highlighted.
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_VIDEO;
reqInfo.MediaPath = "/path/to/video";
reqInfo.ExtraJson = "{\"hashtag \":\"#value\"}";
INTLAPI.Share(reqInfo, INTLChannel.Facebook);
Image: Facebook Gaming mode

Garena

When sharing player content to sub-channels supported by Garena, the channel name and required parameters can be passed to the properties of ExtraJson in the FriendReqInfo data structure when calling the SendMessage or Share methods. Supported sub-channels include Garena, Facebook, and LINE.

After sharing online images to a Garena sub-channel, the images will not be saved to the device local storage.

ExtraJsonRemarks
subChannelGarena sub-channel name
mediaTagNameString based on game requirement, may be empty
captionDescription of the shared content

Sub-channel Garena

The following content can be shared to sub-channel Garena using SendMessage:

  • SendMessage: Text
  • SendMessage: Link
  • SendMessage: Image

SendMessage: Text

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must have installed the Garena app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title
  • Description: Text content
  • ThumbPath: Thumbnail file path
  • ExtraJson - subChannel, mediaTagName
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Title = "INTL share";
reqInfo.Description = "Hello, long time no see";
reqInfo.ThumbPath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
reqInfo.ExtraJson = "{\"subChannel\":\"Garena\",\"mediaTagName\":\"me\"}";
INTLAPI::SendMessage(friendInfo, "Garena");

While Garena does not support Player Network's invite type, invites can be sent via text messages, using mediaTagName as the room ID.

When a friend clicks the invite, the game opens and the mediaTagName value is passed through game_data in ret.ExtraJson during OnAuthBaseResultEvent. The friend then joins the room.

Code sample:

public void OnAuthBaseResultEvent(INTLBaseResult baseRet)
{
if(baseRet.MethodId == (int)INTLMethodID.INTL_AUTH_WAKEUP)
{
// Listen to the team invitation callback
}
}

Response sample:

{
"RetCode":0,
"RetMsg":"Success",
"MethodId":109,
"ThirdCode":-1,
"ThirdMsg":"",
"ExtraJson":"{\"params\":\"{\\\"platform\\\":\\\"1\\\",\\\"from_open_id\\\":\\\"f9aed405b81abfbdfeb305c431335ca3\\\",\\\"open_id\\\":\\\"9317b7044e2feaeff33d1feac2de33b4\\\"}\",\"game_data\":\"33\"}"
}

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the Garena app on their device and is currently logged in.

Parameters:

  • Type
  • Link: URL
  • Title: Title
  • Description: Description
  • ExtraJson - subChannel, mediaTagName, caption
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
reqInfo.Title = "INTL share";
reqInfo.Description = "Hello, long time no see";
reqInfo.ExtraJson = "{\"subChannel\":\"Garena\",\"mediaTagName\":\"me\",\"caption\":\"New Strait Times\"}";
INTLAPI::SendMessage(friendInfo, "Garena");

SendMessage: Image

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the Garena app on their device and is currently logged in.

Parameters:

  • Type
  • ImagePath: Image file path
  • ExtraJson - subChannel, mediaTagName
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
reqInfo.ExtraJson = "{\"subChannel\":\"Garena\",\"mediaTagName\":\"me\"}";
INTLAPI::SendMessage(friendInfo, "Garena");

Sub-channel Facebook

The following content can be shared to sub-channel Facebook using Share:

  • Share: Text
  • Share: Link
  • Share: Image
note

Since Facebook SDK V4.22.0, the Title, Description, Caption and ImagePath fields are no longer supported when sharing links.

Share: Text

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • Description: Text content
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "Hello, long time no see";
reqInfo.ExtraJson = "{\"subChannel\":\"Facebook\"}";
INTLAPI::Share(friendInfo, "Garena");

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • Link: URL
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
reqInfo.ExtraJson = "{\"subChannel\":\"Facebook\"}";
INTLAPI::Share(friendInfo, "Garena");

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the Facebook app on their device.

Parameters:

  • Type
  • ImagePath: Image file path, image cannot exceed 12MB
  • ExtraJson - subChannel, mediaTagName
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
reqInfo.ExtraJson = "{\"subChannel\":\"Facebook\",\"mediaTagName\":\"me\"}";
INTLAPI::Share(friendInfo, "Garena");

Sub-channel LINE

The following content can be shared to sub-channel LINE using SendMessage and Share:

  • SendMessage: Link
  • SendMessage: Image
  • Share: Link
  • Share: Image

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the LINE app on their device, but does not require Garena to be logged in.

Parameters:

  • Type
  • Link: URL
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
reqInfo.ExtraJson = "{\"subChannel\":\"Line\"}";
INTLAPI::SendMessage(friendInfo, "Garena");

SendMessage: Image

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the LINE app on their device, but does not require Garena to be logged in.

Parameters:

  • Type
  • ImagePath: Image file path
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
reqInfo.ExtraJson = "{\"subChannel\":\"Line\"}";
INTLAPI::SendMessage(friendInfo, "Garena");

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the LINE app on their device, but does not require Garena to be logged in.

Parameters:

  • Type
  • Link: URL
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
reqInfo.ExtraJson = "{\"subChannel\":\"Line\"}";
INTLAPI::Share(friendInfo, "Garena");

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the LINE app on their device, but does not require Garena to be logged in.

Parameters:

  • Type
  • ImagePath: Image file path
  • ExtraJson - subChannel
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
reqInfo.ExtraJson = "{\"subChannel\":\"Line\"}";
INTLAPI::Share(friendInfo, "Garena");
Image: Garena LINE share link

Instagram

The following content can be shared to feed, stories, and messages on Instagram using Share:

  • Share: Image
  • Share: Video
note

The Instagram sharing feature requires iOS 15.1 or later. For more information, see the Instagram app on the App Store.

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the Instagram app on their device.

Parameters:

  • Type
  • ImagePath: Image file path, either the path of a local image file or an online URL.
    • Preferred format: JPEG (640 x 640 pixels)
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "/path/to/image";
INTLAPI.Share(reqInfo, INTLChannel.Instagram);

Share: Video

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_VIDEO.
The player must have installed the Instagram app on their device.

Parameters:

  • Type
  • MediaPath: Video file path, either the path of a local video file or an online URL.
    • Format: MP4
    • Min duration: 3s, Max duration: 10mins
    • Min dimensions: 640 x 640 pixels
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_VIDEO;
reqInfo.MediaPath = "/path/to/video";
INTLAPI.Share(reqInfo, INTLChannel.Instagram);

Kakao

Before the SendMessage method can be called, custom message templates should first be registered in Kakao Developer. The templates are shared across Android and iOS versions, see Message template for more details.

  1. Go to Message Template Builder.

    Image: Kakao Message Template Builder

  2. Add or remove template components as needed.

    Image: Kakao message template components

  3. Use User Argument to dynamically fill message content. For example, when selecting Custom for an image, pass the content as {"${KEY}":"{VALUE}"} to the SendMessage method.

    Image: Automatically fill the message content dynamically

For a list of Kakao error codes, see Error code.

The following content can be shared to Kakao using SendMessage:

  • SendMessage: Text
  • SendMessage: Link
  • SendMessage: Image
  • SendMessage: Invite
ExtraJsonRemarks
template_idFixed field, set to the text message template ID
titleUser Argument in the template, format should match the text or URL content in ExtraJson

SendMessage: Text

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must be logged in through the Kakao channel.

Parameters:

  • Type
  • User: OpenID of the recipient.
  • ExtraJson - template_id, ${title}
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.User = ""; // openid
reqInfo.ExtraJson = "{\"template_id\":\"72374\", \"${title}\":\"This is a text message\"}";
INTLAPI.SendMessage (reqInfo, INTLChannel.KaKao);

Sample text message template:

Image: Kakao text message template

note

When sending link type messages, go to App Settings > Platform and register the URL domain in the Web platform.

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must be logged in through the Kakao channel.

Parameters:

  • Type
  • User: OpenID of the recipient.
  • ExtraJson - template_id, ${title}
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.User = ""; // openid
reqInfo.ExtraJson = "{\"template_id\":\"72374\", \"${title}\":\"This is a text message\"}";
INTLAPI.SendMessage (reqInfo, INTLChannel.KaKao);

SendMessage: Image

note

The image should be hosted online with a URL that Kakao can access, else it won't be displayed in the message.

The user argument for images is ${image_path}, pass the image path to req_info.ImagePath or req_info.ThumbPath for Player Network SDK to verify if the image is online.

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must be logged in through the Kakao channel.

Parameters:

  • Type
  • User: OpenID of the recipient.
  • ImagePath: Image file path, needs to be the URL of an online image.
  • ExtraJson - template_id, ${title}
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.User = ""; // openid
reqInfo.ImagePath = "http://*****"; // Image URL
reqInfo.ExtraJson = "{\"template_id\":\"72374\", \"${title}\":\"This is a text message\"}";
INTLAPI.SendMessage (reqInfo, INTLChannel.KaKao);

Sample image message template:

Image: Kakao image message template

The preview section shows the layout of the sent message. An image message includes an image and text.

SendMessage: Invite

note

Players can only invite non-game friends, and cannot send multiple invites to the same friend.

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_INVITE.
The player must be logged in through the Kakao channel.

Parameters:

  • Type
  • User: OpenID of the recipient.
    • Pass an empty string, as invites are meant for non-game friends.
  • ImagePath (Optional): Image file path, needs to be the URL of an online image.
  • ExtraJson - template_id, ${title}
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_INVITE;
reqInfo.User = ""; // openid
reqInfo.ImagePath = "http://*****"; // Image URL
reqInfo.ExtraJson = "{\"template_id\":\"72374\", \"${title}\":\"This is a text message\"}";
INTLAPI.SendMessage (reqInfo, INTLChannel.KaKao);

LINE

The following content can be shared to LINE using SendMessage:

  • SendMessage: Text
  • SendMessage: Image

SendMessage: Text

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.

Parameters:

  • Type
  • Description: Text content
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "INTL services";
INTLAPI.SendMessage(reqInfo, INTLChannel.Line);

SendMessage: Image

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.

Parameters:

  • Type
  • ImagePath: Image file path, either the path of a local image file or an online URL.
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";
INTLAPI.SendMessage(reqInfo, INTLChannel.Line);

Error code

void CheckThirdCode(INTLAuthResult result)
{
if(result.RetCode == 9999)
{
switch(result.ThirdCode):
{
case 5:
//LineSDKInternalErrorCodeInvalidTokenType
break;
case 2:
//LineSDKInternalErrorCodeMissingConfiguration
break;
case 2001:
// Error happens in the underlying `URLSession`.
break;
default:
// Unknown error code
break;
}
}
}
Error codeError information
0Unknown error
1Login error
2Missing configuration
3Verification canceled
4Token loss
5Incorrect token type
6Missing required field
7Invalid value type
8Invalid web key type in JSON
9Token ID verification failed

For more information, see Handling errors.

QQ

QQ supports the following sharing modes:

  • Sharing to QQ Friends: For sharing to QQ friends and groups using the SendMessage method.
  • Sharing to Qzone: For sharing to Qzone using the Share method.

The following content can be shared to QQ using SendMessage and Share:

  • SendMessage: Text
  • SendMessage: Link
  • SendMessage: Image
  • SendMessage: Video
  • Share: Link
  • Share: Image
  • Share: Video

SendMessage: Text

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Description: Text content, max 1,536 characters
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "INTL text sending test";
INTLAPI.SendMessage(reqInfo, INTLChannel.QQ);
Image: QQ send text

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title, max 128 characters
  • Description: Description, max 512 characters
  • Link: URL, max 1,024 characters
  • ThumbPath: Thumbnail file path, image cannot exceed 1MB
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
reqInfo.Title = "INTL test";
reqInfo.Description = "INTL link sending test";
reqInfo.ThumbPath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
INTLAPI.SendMessage(reqInfo, INTLChannel.QQ);
Image: QQ send link

SendMessage: Image

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title
  • Description: Description
  • ImagePath: Image file path, either the path of a local image file or an online URL
var reqInfo = new INTLFriendReqInfo();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.Title = "INTL test";
reqInfo.Description = "INTL description";
reqInfo.ImagePath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
INTLAPI.SendMessage(reqInfo, INTLChannel.QQ);

SendMessage: Video

Call the SendMessage method, with Type set to INTLFriendReqType.Friend_REQ_VIDEO.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title
  • Description: Description
  • MediaPath: Video file path, needs to be the URL of an online video
var reqInfo = new INTLFriendReqInfo ();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_VIDEO;
reqInfo.Title = "Game Video";
reqInfo.Description = "Golden moment";
reqInfo.MediaPath ="http://v.qq.com/cover/5/53x6bbyb07ebl3s/n0013r8esy6.html";
INTLAPI.SendMessage(reqInfo, INTLChannel.QQ);
Image: QQ send video

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title, max 128 characters
  • Description: Description, max 512 characters
  • Link: URL, max 1,024 characters
  • ImagePath: Thumbnail file path, image cannot exceed 1MB
var reqInfo = new INTLFriendReqInfo ();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Title = "INTL share";
reqInfo.Description = "INTL description";
reqInfo.Link = "https://www.google.com";
reqInfo.ImagePath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
INTLAPI.Share(reqInfo, INTLChannel.QQ);
Image: QQ share link

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Description: Description
  • ImagePath: Image file path, either the path of a local image file or an online URL
var reqInfo = new INTLFriendReqInfo ();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.Description = "INTL description";
reqInfo.ImagePath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
INTLAPI.Share(reqInfo, INTLChannel.QQ);

Share: Video

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_VIDEO.
The player must have installed the QQ app on their device and is currently logged in.

Parameters:

  • Type
  • Title: Title
  • Description: Description
  • MediaPath: Video file path, needs to be the URL of an online video
  • ThumbPath: Thumbnail file path
var reqInfo = new INTLFriendReqInfo ();
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_VIDEO;
reqInfo.Title = "Game Video";
reqInfo.Description = "Golden moment";
reqInfo.MediaPath = "http://v.qq.com/cover/5/53x6bbyb07ebl3s/n0013r8esy6.html";
reqInfo.ThumbPath = "http://mat1.gtimg.com/www/qq2018/imgs/qq_logo_2018x2.png";
INTLAPI.Share(reqInfo, INTLChannel.QQ);
Image: QQ share video

System

The native iOS system sharing supports sharing text messages, images, and links. System sharing also supports customizing the system share interface.

Share

The sharing features each have different required parameters, such as Description for text sharing. If irrelevant parameters are entered, such as Link or ImagePath when sharing text, the irrelevant parameters are ignored.

The callback only indicates whether the system sharing interface was successfully opened and does not indicate whether the sharing was successful.

FeatureRequired parameter
Share: TextDescription
Share: LinkDescription
Link
Share: ImageImagePath

Customize system share interface

When customizing the iOS system sharing interface, only iOS system apps, such as mail, reminders, SMS, AirDrop can be deleted. Games cannot select which apps are displayed. When customizing the iOS system interface, all social apps will be shown regardless of ExtraJson configurations.

Report system sharing events

Player Network SDK will report the system sharing events for selected channels, and games can check the report insight_1000_system_share on DD Platform and filter keywords (such as QQ, Facebook, VK) when looking up the reports.

Key fields:

  • name: Callback name, such as vk:com.vkontakte.android.sharing.SharingExternalActivity
  • package_name: Channel package name, such as com.tencent.mqq for QQ

Twitter

The following content can be shared to Twitter using Share:

  • Share: Text
  • Share: Link
  • Share: Image

For a player to share game content to Twitter on iOS, they need to install and log in to the Twitter app on their device before sharing. However, Twitter occasionally fails to redirect to the game when players authorize the game in Twitter on iOS devices. Retrying can resolve the issue.

If a player has multiple Twitter accounts and has switched their login account before sharing game content, the previously logged-in account will be used for sharing. To resolve this issue, add the \"login_first\":1 property to ExtraJson when calling Share to make Twitter go through authorization each time before sharing (without changing the current login status of the game), ensuring that the content is shared with the current account.

Twitter may return a 403 error if the same content is shared repeatedly in a short time.

Share: Text

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must have installed the Twitter app on their device and is currently logged in.

Parameters:

  • Type
  • Description: Text content
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "Hello, long time no see";
INTLAPI.Share(reqInfo, INTLChannel.Twitter);

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the Twitter app on their device and is currently logged in.

Parameters:

  • Type
  • Link: URL
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
INTLAPI.Share(reqInfo, INTLChannel.Twitter);

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the Twitter app on their device and is currently logged in.

Parameters:

  • Type
  • ImagePath: Image file path, either the path of a local image file or an online URL.
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "/path/to/image";
INTLAPI.Share(reqInfo, INTLChannel.Twitter);

VK

The following content can be shared to VK using Share:

  • Share: Text
  • Share: Link
  • Share: Image

Share: Text

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.

Parameters:

  • Type
  • Description: Text content
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "Hello, long time no see";
INTLAPI.Share(reqInfo, INTLChannel.VK);

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.

Parameters:

  • Type
  • Link: URL
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
INTLAPI.Share(reqInfo, INTLChannel.VK);

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.

Parameters:

  • Type
  • ImagePath: Image file path, either the path of a local image file or an online URL.
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "/path/to/image";
INTLAPI.Share(reqInfo, INTLChannel.VK);

WhatsApp

The following content can be shared to WhatsApp using Share:

  • Share: Text
  • Share: Link
  • Share: Image
  • Share: Video
note

When sharing text or links, Share returns success immediately regardless of the actual result.

Image: WhatsApp Android

Share: Text

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_TEXT.
The player must have installed the WhatsApp app on their device and is currently logged in.

Parameters:

  • Type
  • Description: Text content
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_TEXT;
reqInfo.Description = "Hello, long time no see";
INTLAPI.Share(reqInfo, "WhatsApp");

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_LINK.
The player must have installed the WhatsApp app on their device and is currently logged in.

Parameters:

  • Type
  • Link: URL
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_LINK;
reqInfo.Link = "https://www.google.com";
INTLAPI.Share(reqInfo, "WhatsApp");

Share: Image

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_IMAGE.
The player must have installed the WhatsApp app on their device and is currently logged in.

Parameters:

  • Type
  • ImagePath: Image file path
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_IMAGE;
reqInfo.ImagePath = "/path/to/image";
INTLAPI.Share(reqInfo, "WhatsApp");

Share: Video

Call the Share method, with Type set to INTLFriendReqType.Friend_REQ_VIDEO.
The player must have installed the WhatsApp app on their device and is currently logged in.

Parameters:

  • Type
  • MediaPath: Video file path, either the path of a local video file or an online URL.
var reqInfo = new INTLFriendReqInfo
reqInfo.Type = (int)INTLFriendReqType.Friend_REQ_VIDEO;
reqInfo.MediaPath = "/path/to/video";
INTLAPI.Share(reqInfo, "WhatsApp");

Callbacks