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¶
Defined in¶
getInstallState¶
▸ getInstallState(): InstallState
Returns¶
Defined in¶
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.