From 43a439c71799f2da7ed254dda19e6d3602db1903 Mon Sep 17 00:00:00 2001 From: Jiri Pokorny Date: Sun, 6 Oct 2024 22:02:38 +0200 Subject: [PATCH] Implemented apple detection --- projects/planner/src/app/shared/startUp.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/planner/src/app/shared/startUp.ts b/projects/planner/src/app/shared/startUp.ts index dbfc8a66..9da98428 100644 --- a/projects/planner/src/app/shared/startUp.ts +++ b/projects/planner/src/app/shared/startUp.ts @@ -31,7 +31,10 @@ export class DashboardStartUp { } public get showAppleInstall(): boolean { - return true; + const userAgent = window.navigator.userAgent.toLowerCase(); + const isIOs = /iphone|ipad|ipod/.test(userAgent); + const isInStandaloneMode = ('standalone' in window.navigator) && (window.navigator.standalone); + return isIOs && !isInStandaloneMode; } public onDashboard(): void {