Skip to content

Namespace: device

Enumerations

Functions

getBestShareType

getBestShareType(): ShareType

Detect the best share type, based on the browser's user agent and referrer URL. For example, this will return 'facebook' if the game was launched from clicking a Facebook post, or is being played inside the Facebook mobile app.

You can use this to create a share button that the player is more likely to engage with.

Returns

ShareType

Defined in

device/index.ts:85


getInstallState

getInstallState(): InstallState

Returns

InstallState

Defined in

device/index.ts:138


requestInstall

requestInstall(): Promise<boolean>

Requests the player to install the PWA to their home screen.

Returns

Promise<boolean>

Whether the installation was accepted by the player.

Defined in

device/index.ts:146