Skip to content

feat(discord): integrate Discord Social SDK and native Rich Presence - #517

Open
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:feature/discord-social-sdk-integration
Open

feat(discord): integrate Discord Social SDK and native Rich Presence#517
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:feature/discord-social-sdk-integration

Conversation

@Himanth-reddy

@Himanth-reddy Himanth-reddy commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Integrates the Discord Social SDK and native C++ JNI bridge into ARVIO for Discord Rich Presence and OAuth2 account connection. Displays real-time watch activity, movie/show poster artwork, episode information, and elapsed playback position on users' Discord profiles.

Key Changes

  • Native C++ JNI Bridge (discord_bridge.cpp & DiscordBridge.kt): Added CMake build configuration linking via Prefab to the Discord Social SDK. Implemented thread-safe JNI callbacks using recursive mutexes.
  • Discord RPC Manager (DiscordRpcManager.kt): Handled OAuth2 PKCE authorization flow, token exchange (openid sdk.social_layer_presence scope), connection state mapping, debounced presence updates, and automatic disconnect after 1 minute of pause inactivity.
  • Direct Discord App Auth Routing (AndroidManifest.xml & DiscordRpcManager.kt): Added package visibility queries (com.discord & discord://) to automatically route authorization requests directly to the installed Discord Android app before falling back to the web browser.
  • Poster Artwork & Rich Presence Display:
    • Sets activity type to Watching (Watching Arvio).
    • Displays TMDB poster artwork inside the square image box (largeImage).
    • Displays movie titles cleanly with elapsed playback timers (XX:YY elapsed).
    • Displays TV show episode details (S1E1 - The Heirs of the Dragon).
    • Omits empty state strings to strictly comply with Discord SDK string length constraints (2–128 chars).
  • Settings Screen Integration (SettingsScreen.kt): Added Discord Rich Presence account connection row to Settings -> Accounts with dynamic status indicators (Connected / Disconnected).

Screenshots

Movie Watch Activity (Supergirl)

  • Header: Watching Arvio
  • Details: Supergirl
  • Poster Artwork: TMDB Movie Poster (Square)
  • Timer: 11:42 elapsed
image

TV Show Watch Activity (House of the Dragon)

  • Header: Watching Arvio
  • Details: House of the Dragon
  • State: S1E1 - The Heirs of the Dragon
  • Poster Artwork: TMDB Series Poster (Square)
  • Timer: 2:47 elapsed
image

Verification

  • Verified native JNI library initialization and UpdateToken success on Android emulator (127.0.0.1:6555).
  • Tested deep-link authentication redirect (arvio://discord/auth) and token persistence.
  • Confirmed live presence updates, playback timers, poster rendering, and pause timeout logic.

@Himanth-reddy
Himanth-reddy force-pushed the feature/discord-social-sdk-integration branch from 403edc5 to 7349feb Compare August 6, 2026 08:32
@Himanth-reddy
Himanth-reddy force-pushed the feature/discord-social-sdk-integration branch from 7349feb to f87412c Compare August 6, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant