Skip to main content

AndroidDiscord

Kindclass
Packageandroid.platform
Full nameandroid.platform.AndroidDiscord
Sourcesource/android/platform/AndroidDiscord.hx

Android stand-in for Discord Rich Presence.

Discord's RPC SDK is desktop-only and Android has no native rich presence API. The system media session on Android is owned by PlayStateAndroidMedia during gameplay; this class intentionally does NOT touch it, so toggling Discord RPC in the options (which calls shutdown) can never tear down or overwrite an active media session.

This keeps DiscordClient callers platform-agnostic behind one API (the platform abstraction described in the roadmap).

Public methods​

initialize​

static function initialize():Void

View source

shutdown​

static function shutdown():Void

View source

changePresence​

static function changePresence(details:String, state:String, ?largeImageKey:String, ?durationMs:Float):Void

Mirrors DiscordClient.changePresence on Android. Menu presence is not surfaced on Android (there is no Discord client); the session is only published for actual gameplay by PlayStateAndroidMedia.

ParameterTypeDefault
detailsString—
stateString—
largeImageKey (optional)String—
durationMs (optional)Float—

View source

Internals​

Private / internal members
FieldTypeStatic
runningBoolyes