Gnomeuel
Gnomeuel
Explore posts from servers
NNuxt
Created by Gnomeuel on 7/10/2024 in #❓・help
PWA Detection Logic Not Working on Apple TestFlight
Hi everyone, I'm currently facing an issue with my Progressive Web App (PWA) when it's distributed via Apple TestFlight. The logic I've implemented to detect if the app is installed or being used in a browser works perfectly in normal scenarios but fails when the app is running through TestFlight. Here is a simplified version of the detection logic I'm using:
onBeforeMount(() => {
if (
(window.navigator as any).standalone ||
window.matchMedia('(display-mode: standalone)').matches
) {
settings.setIsInstalled(true);
return;
}

settings.setIsInstalled(false);
});
onBeforeMount(() => {
if (
(window.navigator as any).standalone ||
window.matchMedia('(display-mode: standalone)').matches
) {
settings.setIsInstalled(true);
return;
}

settings.setIsInstalled(false);
});
This works as expected in browsers and when the PWA is installed on both iOS and Android. However, when running the PWA via TestFlight, it doesn't detect the app as being installed.
1 replies