feat: Implement comprehensive PWA functionality
- Add full PWA configuration with manifest and service worker - Create PWAInstallBanner component with mobile detection - Implement install banner on login page (shows below login form) - Add usePWA composable for reusable PWA functionality - Configure offline support with Workbox caching strategies - Add PWA initialization plugin - Update app name to 'Port Nimara Portal' throughout - Use circular logo in install banner and instructions - Banner shows only once and hides if already installed - Support both Android (direct install) and iOS (manual instructions) - Add comprehensive documentation for PWA implementation Features: - Mobile-only install banner with dismissal tracking - Standalone mode detection to hide banner when installed - Platform-specific installation instructions - Offline functionality with API caching - Auto-updating service worker - Native app-like experience when installed
This commit is contained in:
16
plugins/pwa.client.ts
Normal file
16
plugins/pwa.client.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export default defineNuxtPlugin(() => {
|
||||
const { init } = usePWA();
|
||||
|
||||
// Initialize PWA functionality when the app starts
|
||||
if (process.client) {
|
||||
init();
|
||||
|
||||
// Register service worker update handler
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
console.log('PWA updated successfully');
|
||||
// You could show a toast notification here
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user