Packaging · class
NativePlatformServices
A store's achievements and presence, over the bridge.
Explained in Packaging an application.
class NativePlatformServices implements PlatformServicesimport { NativePlatformServices } from '@driftengine/package';In depth
Only created where a store answered. createHost returns null for services otherwise,
which is the same shape the engine's own interface has: there is no browser implementation of
PlatformServices because there is nothing honest for one to do, and a game that gets null
simply never calls it.
Neither method reports failure, deliberately. An achievement that does not unlock is not a reason for a frame to stop, and a store that is offline is an ordinary state.
Constructor
new
constructor(bridge: DriftHostBridge)| Parameter | Type | Description |
|---|---|---|
bridge | DriftHostBridge |
Methods
unlockAchievement
unlockAchievement(id: string): void| Parameter | Type | Description |
|---|---|---|
id | string |
setRichPresence
setRichPresence(text: string): void| Parameter | Type | Description |
|---|---|---|
text | string |