Class: ShareApi

share.ShareApi

Share wrapper class. Handles generic sharing as well as context updates.

Constructors

constructor

new ShareApi(client): ShareApi

Parameters

Name Type
client Client

Returns

ShareApi

Properties

client

Private client: Client

Methods

isSupported

isSupported(): boolean

Check whether share is supported by the target platform.

Returns

boolean


log

log(event, parameters): void

Parameters

Name Type
event string
parameters Object

Returns

void


share

share(payload, analyticsId?): Promise<ShareResult>

This invokes a dialog to let the user share specified content. A blob of data can be attached to the share which every game session launched from the share will be able to access via client’s getEntryPointData(). This data must be less than or equal to 1000 characters when stringified. The user may choose to cancel the share action and close the dialog, and the returned promise will resolve when the dialog is closed regardless if the user actually shared the content or not.

Parameters

Name Type Description
payload SharePayload Contents of the share
analyticsId? string Optional entrypoint id that will be logged with all analytics events of players who enter via the shared entrypoint. Also used as the sharepoint param in share analytics events.

Returns

Promise<ShareResult>