PWA distribution strategy for RunSmart including app store optimization, web install prompts, TWA (Trusted Web Activity) for Google Play, Apple Add-to-Home-Screen optimization, and cross-platform distribution channels. Use when planning app distribution, optimizing install rates, or expanding to new platforms.
beforeinstallprompt handling// Install prompt strategy
// Don't show immediately — wait until user completes onboarding
let deferredPrompt: BeforeInstallPromptEvent | null = null;
window.addEventListener('beforeinstallprompt', (e) => {
e.preventDefault();
deferredPrompt = e;
});
// Show after onboarding completion
async function showInstallPrompt() {
if (deferredPrompt) {
deferredPrompt.prompt();
const result = await deferredPrompt.userChoice;
// Track: install_prompt_shown, install_accepted/declined
}
}
# Generate TWA with Bubblewrap
npx @nicolo-ribaudo/bubblewrap init \
--manifest https://runsmart.app/manifest.json
npx @nicolo-ribaudo/bubblewrap build
Play Store Listing:
<head><meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="RunSmart">
<link rel="apple-touch-icon" href="/icons/apple-icon-180.png">
| Priority | Keywords | Monthly Searches |
|---|---|---|
| P0 | running coach app | 12K |
| P0 | AI running coach | 3K |
| P0 | personalized training plan | 5K |
| P1 | couch to 5k | 40K |
| P1 | run tracker | 20K |
| P1 | marathon training plan | 8K |
| P2 | running app free | 15K |
| P2 | GPS run tracker | 10K |
{
"name": "RunSmart - AI Running Coach",
"short_name": "RunSmart",
"description": "Personalized AI training plans that adapt to your progress",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#2563eb",
"orientation": "portrait",
"categories": ["health", "fitness", "sports"],
"screenshots": [...],
"icons": [
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png" },
{ "src": "/icons/maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
]
}
V0/public/manifest.jsonV0/public/sw.js or next-pwa configV0/components/InstallPrompt.tsxV0/lib/analytics.ts