docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SharePayload

    Represents the content a user can share.

    Inheritance
    object
    JsObject
    SharePayload
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Meta.InstantGames
    Assembly: Unity.Meta.InstantGames.Sdk.dll
    Syntax
    public class SharePayload : JsObject

    Constructors

    SharePayload()

    Construct an instance of SharePayload

    Declaration
    public SharePayload()

    SharePayload(string, string, string, ShareDestination[], bool?)

    Creates a new instance of SharePayload

    Declaration
    public SharePayload(string image, string text, string data = null, ShareDestination[] shareDestination = null, bool? switchContext = null)
    Parameters
    Type Name Description
    string image

    A Base64-encoded image to be shared.

    string text

    A text message to include in the share.

    string data

    An optional blob of data to attach to the share dialog, serialized as a JSON string. This string must represent a JSON object such as {"key": "value"}. All game sessions launched from the share dialog can access this blob through GetEntryPointData().

    ShareDestination[] shareDestination

    An optional array to set sharing destinations in the share dialog. If not set, all available sharing destinations are displayed.

    bool? switchContext

    An optional flag indicating whether to switch the user into the new context created when the share occurs.

    Properties

    Data

    An optional blob of data to attach to the share dialog, serialized as a JSON string. This string must represent a JSON object such as {"key": "value"}. All game sessions launched from the share dialog can access this blob through GetEntryPointData().

    Declaration
    public string Data { get; }
    Property Value
    Type Description
    string

    Image

    A Base64-encoded image to be shared.

    Declaration
    public string Image { get; }
    Property Value
    Type Description
    string

    ShareDestination

    An optional array to set sharing destinations in the share dialog. If not set, all available sharing destinations are displayed.

    Declaration
    public ShareDestination[] ShareDestination { get; }
    Property Value
    Type Description
    ShareDestination[]

    SwitchContext

    An optional flag indicating whether to switch the user into the new context created when the share occurs.

    Declaration
    public bool? SwitchContext { get; }
    Property Value
    Type Description
    bool?

    Text

    A text message to include in the share.

    Declaration
    public string Text { get; }
    Property Value
    Type Description
    string
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)