Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

617 B
Raw Blame
import { Capacitor } from '@capacitor/core';

/** True inside the iOS and Android apps, where the WebView shows this server's UI. */
export function isNativeApp(): boolean {
  return Capacitor.isNativePlatform();
}

export function isNativeIos(): boolean {
  return isNativeApp() && Capacitor.getPlatform() === 'ios';
}

export function isNativeAndroid(): boolean {
  return isNativeApp() && Capacitor.getPlatform() === 'android';
}

/** The server the app is connected to: the WebView sits on its origin. */
export function nativeServerHost(): string | null {
  return isNativeApp() ? window.location.host : null;
}