Fix Android PWA installation - add proper web app instead of shortcut

Android PWA Requirements:
- Add mobile-web-app-capable meta tag for Android
- Add application-name meta tag
- Add prefer_related_applications: false to manifest
- Add explicit icon sizes (192x192, 512x512) for both any and maskable
- Add orientation: any for flexible display
- Add lang and dir to manifest for proper localization
- Add ?source=pwa to start_url for analytics
- Add crossorigin="use-credentials" to manifest link
- Add proper service worker registration in main.ts
- Add vite-plugin-pwa/client types to env.d.ts

This ensures Android recognizes it as a full PWA instead of creating a shortcut

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Dorian
2026-02-03 00:03:00 +00:00
parent 91dd58c0b2
commit 0031456f4e
4 changed files with 32 additions and 4 deletions

View File

@@ -10,3 +10,12 @@ app.use(createPinia())
app.use(router)
app.mount('#app')
// Register PWA service worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js').catch(() => {
// Service worker registration failed, that's okay
})
})
}