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- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as core_socials from "gamepush.core.socials"
- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
Functions
is_supports_share(): booleanis_supports_native_share(): booleanshare(parameters?: Record<string, unknown>)is_supports_native_posts(): booleanpost(parameters?: Record<string, unknown>)is_supports_native_invite(): booleaninvite(parameters?: Record<string, unknown>)can_join_community(): booleanis_supports_native_community_join(): booleanjoin_community()make_share_url(parameters: Record<string, unknown>): stringget_share_param(parameter: string): string | undefined
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'ssocials.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'ssocials.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'ssocials.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 byget_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.