diff --git a/index.html b/index.html index 0343d567..154d2931 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ + diff --git a/package.json b/package.json index d57bde50..0045cbda 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "preview": "vite preview", "test:mobile": "wdio run wdio.conf.js --exclude safari", "test:android": "wdio run wdio.conf.js --spec test/specs/*.spec.js", - "wdio": "wdio run ./wdio.conf.js" + "wdio": "wdio run ./wdio.conf.js", + "twa:build": "bubblewrap build", + "twa:update": "bubblewrap update" }, "dependencies": { "@azure/msal-browser": "^4.12.0", diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 00000000..7b589f68 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "name": "Truck Wash Kundeportal", + "short_name": "Truck Wash", + "description": "Access your Truck Wash accounts and transactions from anywhere.", + "icons": [ + { + "src": "/favicons/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicons/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + } + ], + "start_url": "/", + "display": "standalone", + "background_color": "#0787bb", + "theme_color": "#063651", + "orientation": "portrait", + "scope": "/" +} diff --git a/twa-manifest.json b/twa-manifest.json new file mode 100644 index 00000000..532544a7 --- /dev/null +++ b/twa-manifest.json @@ -0,0 +1,28 @@ +{ + "packageId": "dk.truckwash.kundeportal.twa", + "host": "kundeportal.truckwash.dk", + "name": "Truck Wash Kundeportal", + "launcherName": "Truck Wash", + "displayMode": "standalone", + "themeColor": "#063651", + "backgroundColor": "#0787bb", + "startUrl": "/", + "iconUrl": "https://kundeportal.truckwash.dk/favicons/web-app-manifest-512x512.png", + "maskableIconUrl": "https://kundeportal.truckwash.dk/favicons/web-app-manifest-512x512.png", + "splashScreenFadeOutDuration": 300, + "signingKey": { + "path": "./android.keystore", + "alias": "android" + }, + "appVersionCode": 1, + "appVersionName": "1.0.0", + "generatorApp": "bubblewrap-cli", + "webManifestUrl": "https://kundeportal.truckwash.dk/manifest.json", + "fallbackType": "customtabs", + "enableNotifications": true, + "enableSiteSettingsShortcut": true, + "isRtl": false, + "orientation": "portrait", + "thumbnails": false, + "shareTarget": false +} diff --git a/vite.config.js b/vite.config.js index 96ef03eb..efcb9810 100644 --- a/vite.config.js +++ b/vite.config.js @@ -60,6 +60,8 @@ export default defineConfig(({ mode }) => { enableSingleFile && viteSingleFile(), VitePWA({ registerType: 'autoUpdate', + injectRegister: 'auto', + strategies: 'generateSW', devOptions: { enabled: true // keep for local dev }, @@ -140,7 +142,8 @@ export default defineConfig(({ mode }) => { // { src: 'icons/icon-512x512-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' } ], id: 'pleno-pwa-test' - } + }, + useCredentials: true }) ].filter(Boolean), resolve: {