Mobile
Your project includes a mobile app package built with Expo SDK 54 and React Native. The app displays your web application in a full-screen WebView with native push notification support for both iOS and Android.
Prerequisites
- Node.js 20.19.4+ and pnpm
- For iOS: macOS with Xcode 16+, Apple Developer account
- For Android: Android Studio with Android SDK
Getting started
1. Configure the web URL
cd packages/mobile
cp .env.example .envEdit .env:
# Development
EXPO_PUBLIC_IOS_WEB_URL=http://localhost:5173
EXPO_PUBLIC_ANDROID_WEB_URL=http://10.0.2.2:5173
# Production
# EXPO_PUBLIC_IOS_WEB_URL=https://your-production-url.com
# EXPO_PUBLIC_ANDROID_WEB_URL=https://your-production-url.com2. Update app identifiers
Edit app.json:
{
"expo": {
"name": "Your App Name",
"slug": "your-app-slug",
"ios": {
"bundleIdentifier": "com.yourcompany.yourapp"
},
"android": {
"package": "com.yourcompany.yourapp"
}
}
}3. Run in development
# Start the web dev server first
pnpm dev
# Start Expo
pnpm --filter @project/mobile start
# Run on platform
pnpm --filter @project/mobile ios # iOS simulator
pnpm --filter @project/mobile android # Android emulatorHow it works
WebView integration
The app uses react-native-webview to display the web application in a full-screen native view:
- Loads from
localhost:5173(dev) or production URL - Enables JavaScript and DOM storage
- Shares cookies with native storage
- Supports back/forward navigation gestures on iOS
Native-to-web bridge
The app provides a bidirectional communication bridge:
// Check if running in native app
window.isNativeApp; // true
window.nativePlatform; // 'ios' | 'android'
// Request push token
window.requestPushToken();
// Listen for token response
window.addEventListener('pushToken', (event: CustomEvent) => {
console.log(event.detail.token);
console.log(event.detail.platform);
});Helper functions are available in packages/frontend/src/shared/lib/nativeApp.ts.
Push notifications
Setup
- Create a Firebase project at Firebase Console.
- Add iOS and Android apps, download
GoogleService-Info.plistandgoogle-services.json. - Place both files in
packages/mobile/certificates/. - Replace
app.jsonwithapp-with-google-services-file.json:
mv app-with-google-services-file.json app.json- For iOS: upload APNs certificate/key to Firebase Console.
- Initialize EAS:
npm install -g eas-cli
cd packages/mobile
eas initHow push works
- App requests notification permissions on launch.
- Expo push token is registered.
- After sign-in, the web side calls
handlePushTokenAfterAuth()to get the token. - Token is sent to the backend for storage.
- Backend sends push notifications via Expo's API.
Note: Push notifications require a physical device. They won't work in simulators. Android requires a development build (not Expo Go) starting from SDK 53+.
Building for production
# iOS
eas build --platform ios
eas submit --platform ios
# Android
eas build --platform android
eas submit --platform androidApp assets
Place these images in packages/mobile/assets/:
| File | Size | Purpose |
|---|---|---|
icon.png | 1024x1024px | App icon |
adaptive-icon.png | 1024x1024px | Android adaptive icon |
splash.png | 1284x2778px | Splash screen |
favicon.png | 48x48px | Web favicon |
notification-icon.png | 96x96px | Android notification icon |
Key files
| File | Description |
|---|---|
packages/mobile/App.tsx | Main app with WebView + push |
packages/mobile/app.json | Expo configuration |
packages/mobile/certificates/ | Firebase config files |
frontend/src/shared/lib/nativeApp.ts | Native bridge utilities |