Skip to content

Track user platform (iOS/Android/Web) for quest verification#2105

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/sleepy-goldberg-jCaPr
May 28, 2026
Merged

Track user platform (iOS/Android/Web) for quest verification#2105
MusabShakeel576 merged 1 commit into
qafrom
claude/sleepy-goldberg-jCaPr

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

Add platform tracking functionality to record which surfaces (iOS, Android, or Web) users have accessed the app from. This enables backend quest checks to verify platform-specific requirements, such as Layer3's "download the native app" quest.

Changes

  • New hook useTrackUserPlatform: Automatically records the current platform once per authenticated session on app launch

    • Fires only when user is authenticated
    • Prevents duplicate tracking with a ref-based guard
    • Gracefully handles failures with error logging
    • Supports iOS, Android, and Web platforms
  • New API endpoint trackUserPlatform: POST request to /accounts/v1/users/platforms that sends the platform identifier to the backend

    • Includes JWT authentication when available
    • Uses standard platform headers and credentials
  • Integration in root layout: Hook is initialized at the app root level to ensure it runs once per session for all authenticated users

Implementation Details

  • Uses useRef to ensure the platform is tracked only once per session, even if the authentication state changes
  • Silently fails with a console warning if the API call fails, allowing the app to continue functioning
  • Only tracks supported platforms (iOS, Android, Web) to avoid sending invalid values

https://claude.ai/code/session_0189ZJf487m6dczN4NKQhbrK

Call POST /accounts/v1/users/platforms once per authenticated session
with Platform.OS, so the backend can verify "downloaded the app" Layer3
quests via /v1/layer3-quests/check-native-app.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored May 28, 2026 8:36am
solid-app-staging Ignored Ignored May 28, 2026 8:36am

Request Review

@MusabShakeel576 MusabShakeel576 merged commit b8e00a6 into qa May 28, 2026
4 of 5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/sleepy-goldberg-jCaPr branch May 28, 2026 08:42
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.

2 participants