From a39f97a4be76720b89a83ecfa60003e6e1bb2aee Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 3 Nov 2026 13:17:31 +1000 Subject: [PATCH] Fixed PWA on iOS 27 --- composer.json | 2 +- dockerfile | 4 ++-- resources/js/Layouts/MainLayout.vue | 33 +++++++++++++++++++++++++++++ resources/views/app.blade.php | 1 - routes/web.php | 7 ++++++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index a785cda..7379d0c 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ ], "license": "MIT", "require": { - "php": "^8.4", + "php": "^8.5.12", "ext-pdo": "*", "inertiajs/inertia-laravel": "^2.0", "laravel-notification-channels/webpush": "^11.0", diff --git a/dockerfile b/dockerfile index 1f0c9b9..c83a747 100644 --- a/dockerfile +++ b/dockerfile @@ -1,7 +1,7 @@ -FROM php:8.4-fpm-alpine +FROM php:8.5-fpm-alpine RUN apk add --no-cache nginx curl zip unzip git postgresql-dev nodejs npm dcron \ - && docker-php-ext-install pdo pdo_pgsql pgsql opcache pcntl + && docker-php-ext-install pdo pdo_pgsql pgsql pcntl RUN docker-php-ext-install bcmath COPY --from=composer:latest /usr/bin/composer /usr/bin/composer diff --git a/resources/js/Layouts/MainLayout.vue b/resources/js/Layouts/MainLayout.vue index 420dec7..5647b5d 100644 --- a/resources/js/Layouts/MainLayout.vue +++ b/resources/js/Layouts/MainLayout.vue @@ -17,11 +17,34 @@ const page = usePage().props router.on('success', () => { transitionKey.value++; }); + +const isIOS27PlusPWA = (() => { + const ua = navigator.userAgent; + + const isStandalone = + window.matchMedia('(display-mode: standalone)').matches || + (navigator as Navigator & { standalone?: boolean }).standalone; + + if (!isStandalone) return false; + + // iPhone / iPad detection + const isIOS = + /iPhone|iPad|iPod/.test(ua) || + (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); + + if (!isIOS) return false; + + // iOS 27+ detection (Safari version token) + const version = ua.match(/Version\/(\d+)/); + + return version && parseInt(version[1]) >= 27; +})();