From 2f82a64dbeaf82d86408e01190d471db9334b89b Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sat, 1 Nov 2025 16:06:07 +0100 Subject: [PATCH] Add isNativeMobile --- web/lib/util/webview.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/lib/util/webview.ts b/web/lib/util/webview.ts index 39396799..cecdb7bd 100644 --- a/web/lib/util/webview.ts +++ b/web/lib/util/webview.ts @@ -1,8 +1,14 @@ +import {Capacitor} from "@capacitor/core"; +import {IS_WEBVIEW} from "common/hosting/constants"; + export function isAndroidWebView() { try { // Detect if Android bridge exists - return typeof (window as any).AndroidBridge?.isNativeApp === 'function'; + // return typeof (window as any).AndroidBridge?.isNativeApp === 'function'; + return Capacitor.isNativePlatform() || IS_WEBVIEW } catch { return false; } -} \ No newline at end of file +} + +export function isNativeMobile() { return isAndroidWebView() } \ No newline at end of file