This branch adds native iOS app support using Capacitor.
-
Start the Next.js dev server (required for Capacitor to connect):
npm run dev
This runs on
http://localhost:3000by default. -
In another terminal, sync and open iOS project:
npx cap sync ios npx cap open ios
-
In Xcode, select the simulator or device and hit Play to run.
-
Build Next.js:
npm run build
-
Sync to Capacitor:
npx cap sync ios
-
In Xcode, build and archive for App Store submission.
- Web Layer: Next.js app serving
/m/mobile routes + API endpoints - Native Layer: Capacitor wraps the web app and provides:
- Native iOS permissions access
- Push notifications (APNs)
- Safari-based OAuth (Discord login)
- App deeplinks
The capacitor.config.ts automatically:
- Uses
localhost:3000in development - Uses
.next/standalone/publicin production - Disables SplashScreen to avoid delays
In development, the app loads from your local Next.js server. Make sure:
- Next.js is running (
npm run dev) - You can access
http://localhost:3000/min your browser - The iOS simulator can reach localhost (it can by default)
Currently requires manual implementation. When you're ready:
- Add a custom Discord callback handler that detects Capacitor
- Open Discord auth in Safari using
openInSafari()from@/lib/capacitor - Handle the OAuth callback via deeplinks
See src/lib/capacitor.ts for utility functions.
To enable push notifications:
- Get APNS certificate from Apple Developer
- Install
@capacitor/push-notifications - Update the iOS project config with certificate info
- Handle incoming notifications in your React components
This replaces the Web Push system (PWA) and uses Apple's native APNs.
@capacitor/push-notifications- Native push@capacitor/browser- Open Safari for OAuth@capacitor/app- Handle deeplinks and app lifecycle
"Cannot reach localhost:3000"
- Make sure
npm run devis running - Check firewall settings
- Verify iOS simulator can access localhost (usually works by default)
Blank screen on launch
- Check Xcode console for errors
- Verify Next.js is building correctly (
npm run build) - Clear Capacitor cache:
npx cap sync ios --deployment
OAuth not working
- Implement the custom Discord callback handler
- Register app deeplink scheme in Xcode settings
- Test with
openInSafari()first
- ✅ Capacitor initialized
- ✅ iOS platform added
- ⏳ Implement Discord OAuth with Safari
- ⏳ Set up push notifications with APNs
- ⏳ Test app on real device
- ⏳ Prepare for App Store submission