Back to Eliza

Implementation Status & Remaining Work

packages/feed/docs/planning/mobile/07-status.md

2.0.37.2 KB
Original Source

Implementation Status & Remaining Work

Progress

PhaseStatusDetails
Phase 0: PoC✅ CompletePrivy verified on Android emulator + Pixel 10
Phase 1a: Web refactors✅ Complete~190 fetch calls, 3 API routes, shared code moves
Phase 1b: Mobile app✅ Complete39 pages, 41 HTML output, 32MB static export
Phase 2: Capacitor integration✅ Code completeAppUrlListener, OAuth config, CORS, deep link files
Phase 3: Native features✅ Code completeHaptics, push, status bar, deep links, app icon
Phase 4: App Store prep❌ Not startedScreenshots, descriptions, signing, legal
Phase 5: Submit❌ Not startedTestFlight, Play Store, review

Detailed Checklists

Phase 0: PoC ✅

  • Privy SDK initializes in Capacitor WebView
  • Embedded wallet iframe loads without blocking errors
  • OAuth redirect flow fires correctly
  • Full app renders and navigates on real Pixel 10

Phase 1a: Web App Refactors ✅

  • apiUrl() utility (apps/web/src/utils/api-url.ts)
  • ~190 fetch calls updated across ~150 files
  • SSE URL construction fixed (useSSE.ts, SSEManager.ts)
  • Shared code moved out of app/ directory
  • 3 new API routes (/api/onchain, /api/nft/mint/execute, /api/profiles/resolve/[identifier])
  • 3 hooks rewritten to use API routes instead of server actions
  • 46 unit tests passing
  • Web app typechecks clean, no regressions

Phase 1b: Mobile App ✅

  • apps/mobile/ with Next.js static export (output: 'export')
  • Webpack aliases sharing code from apps/web/src/
  • @web/ alias for web page imports without route discovery
  • 39 mobile pages (29 re-exported, 10 mobile-specific)
  • 13 dynamic routes with server/client split + generateStaticParams
  • Custom image loader, mobile-specific root layout

Phase 2: Capacitor Integration ✅ (code complete)

  • capacitor.config.ts with dev/prod mode support
  • All Capacitor plugins in package.json
  • AppUrlListener component for Privy OAuth deep links
  • customOAuthRedirectUrl passed to Privy via Providers prop
  • Platform detection utility (isNativePlatform, getPlatform, isIOS, isAndroid)
  • apple-app-site-association + assetlinks.json (placeholder IDs)
  • CORS origins added to middleware

Phase 3: Native Features ✅ (code complete)

  • Haptic feedback utility
  • Push notification client (permission, registration, foreground, tap)
  • Push token API routes (Redis-backed, 90-day TTL)
  • Status bar theming (dark/light sync, edge-to-edge)
  • Android back button handling
  • App lifecycle listeners (resume from background)
  • Keyboard height CSS variable (--keyboard-height)
  • Native init orchestration in mobile layout
  • App icon (1024×1024 source) + splash screen config
  • @capacitor/assets generate script

Remaining Work

Infrastructure (requires external access)

ItemNeedsWho
npx cap add iosmacOS + XcodeAnyone with a Mac
bun run generate:assetsRun after cap addSame
Privy dashboard: Capacitor allowed originsDashboard loginAdmin
Privy dashboard: OAuth redirect URLDashboard loginAdmin
Vercel: CORS_ALLOWED_ORIGINS env varVercel dashboardAdmin
apple-app-site-association TEAM_IDApple Developer accountAdmin
assetlinks.json SHA256Android signing keystoreAdmin
iOS Info.plist + Android AndroidManifest.xmlAfter cap add generates native projectsDev
Firebase project for FCM push deliveryFirebase consoleAdmin
Push sending serviceBackend worker or OneSignalBackend dev

Decisions Needed (blocking for App Store)

ItemTypeOwner
Prediction markets — gambling classification?Legal researchLegal
Stripe IAP — use Apple IAP or remove purchases?Business decisionProduct

App Store Prep

ItemNeedsOwner
Screenshots (iPhone + Android)Device capturesDesign
Store descriptions + keywordsCopywritingMarketing
Privacy policyLegal documentLegal
Code signing (iOS + Android)Developer accountsAdmin
TestFlight / Play Store internal testingBuild + submitDev

Risk Status

RiskStatusNotes
Privy in WebView✅ VerifiedTested on emulator + real device
CORS blocks API calls✅ Fixed in codeDeploy to Vercel pending
Fetch calls use relative URLs✅ All updated~190 calls across ~150 files
Server actions in static export✅ Converted3 API routes created
Shared code imports @/app/✅ Moved6 imports resolved
Apple rejects as web wrapper⚠️ Medium riskNative plugins provide mitigation
Apple rejects for prediction markets⚠️ Unknown riskLegal research needed
Cookie auth cross-origin⚠️ Low riskBearer token fallback exists
SSE on mobile⚠️ Low riskReconnection logic exists, needs testing
Stripe in WebView⚠️ UnknownNeeds testing + IAP decision

Dev Setup

First-time Android setup (inside devcontainer)

bash
# 1. Install dependencies
bun install

# 2. Initialize the Android project (only needed once)
cd apps/mobile && npx cap add android

# 3. Generate app icons and splash screens
bun run generate:assets

# 4. Build the mobile Next.js app and sync to Android project
bun run mobile:build

The android/ directory will appear in apps/mobile/android/ on your host machine via the bind mount — open it directly in Android Studio.

Android Testing (devcontainer + local Android Studio)

bash
# --- Inside devcontainer ---
# Start the mobile dev server (port 3077 is forwarded to your host automatically)
cd apps/mobile && bun run dev

# --- On your host machine ---
# Forward device's localhost to host's localhost:3077
# (for physical device connected via USB)
~/Android/Sdk/platform-tools/adb reverse tcp:3077 tcp:3077

# For emulator, use 10.0.2.2 instead of localhost in the config below

Set CAPACITOR_SERVER_URL in your .env (or export it):

bash
# Physical device (via adb reverse)
CAPACITOR_SERVER_URL=http://localhost:3077

# Android emulator (accesses host via 10.0.2.2)
CAPACITOR_SERVER_URL=http://10.0.2.2:3077

Then rebuild and sync:

bash
# Inside devcontainer
cd apps/mobile && bun run mobile:build
# Open android/ in Android Studio and run the app

Port forwarding chain (physical device):

Android device (localhost:3077)
  → adb reverse →
Host machine (localhost:3077, forwarded from devcontainer)
  → devcontainer port forward →
Devcontainer (localhost:3077 = Next.js mobile dev server)

Production Build

bash
cd apps/mobile

# Set env vars
NEXT_PUBLIC_API_URL=https://play.feed.market \
NEXT_PUBLIC_PRIVY_APP_ID=<privy-app-id> \
bun run build

# Sync to native projects
npx cap sync

# Generate all icon/splash sizes
bun run generate:assets

# Open in IDE
npx cap open android  # or npx cap open ios

Unit Tests

bash
cd /path/to/bab
bun test packages/testing/unit/mobile/ --preload ./packages/testing/unit/preload.ts
# 46 tests, 3 test files