Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

692 B
Raw Blame
// Whether the web app runs inside the Linedesk app (apps/mobile, a Capacitor shell around these same pages) and on
// which system. In a normal browser everything here says "web" and the native parts stay unused.
import { Capacitor } from '@capacitor/core'

export type NativePlatform = 'ios' | 'android'

/** True inside the iOS or Android app. */
export const isNativeApp = (): boolean => Capacitor.isNativePlatform()

/** 'ios' or 'android' inside the app, null in a browser. */
export function nativePlatform(): NativePlatform | null {
  if (!isNativeApp()) return null
  const platform = Capacitor.getPlatform()
  return platform === 'ios' || platform === 'android' ? platform : null
}