Skip to Content
defold-typescript libraries
megalanthusdefold-gamepush

megalanthus/defold-gamepush/gamepush.core.socials

GamePush social actions: share, post, invite friends, join the community and share links, with their events.

  • GitHub: megalanthus/defold-gamepush — pinned to v1.4.1
    1. Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as core_socials from "gamepush.core.socials"

Functions

is_supports_share(): boolean

Whether sharing is supported.

Returns

  • boolean

is_supports_native_share(): boolean

Whether the platform's native sharing is supported.

Returns

  • boolean

share(parameters?: Record<string, unknown>)

Shares a link to the game.

Parameters

  • parameters?: Record<string, unknown> — The options for the SDK's socials.share, or nil for the defaults.

is_supports_native_posts(): boolean

Whether the platform's native posting is supported.

Returns

  • boolean

post(parameters?: Record<string, unknown>)

Publishes a post.

Parameters

  • parameters?: Record<string, unknown> — The options for the SDK's socials.post, or nil for the defaults.

is_supports_native_invite(): boolean

Whether the platform's native invites are supported.

Returns

  • boolean

invite(parameters?: Record<string, unknown>)

Invites friends to the game.

Parameters

  • parameters?: Record<string, unknown> — The options for the SDK's socials.invite, or nil for the defaults.

can_join_community(): boolean

Whether the player can be invited to the community on this platform.

Returns

  • boolean

is_supports_native_community_join(): boolean

Whether the platform's native community join is supported.

Returns

  • boolean

join_community()

Joins the game's community.

make_share_url(parameters: Record<string, unknown>): string

A share link that carries the given parameters. Raises when the table is missing.

Parameters

  • parameters: Record<string, unknown> — The parameters to put in the link, read back by get_share_param.

Returns

  • string

get_share_param(parameter: string): string | undefined

The value of a parameter in the link the player came from, or nil when the link has none. Raises unless parameter is a string.

Parameters

  • parameter: string — The parameter's name.

Returns

  • string | undefined

Variables

callbacks: SocialsCallbacks

The social action event handlers.

Types

SocialsCallbacks

SocialsCallbacks.share?: (success: boolean) => void

A share finished.

SocialsCallbacks.post?: (success: boolean) => void

A post finished.

SocialsCallbacks.invite?: (success: boolean) => void

An invite to friends finished.

SocialsCallbacks.join_community?: (success: boolean) => void

Joining the community finished.

On this page