Skip to content

What runs where

Most native APIs are for computers, a few are for phones only, and some work on both. This page lists each one, so that you find out before you build a screen around it.

Computers are Linux, macOS and Windows. Linux is the one Nativella is developed on, and every API was tried on a Mac too, with macOS 14. Windows is untested (see Limitations and roadmap). Phones are Android, tested on an emulator, and iOS, in the simulator only. No phone API has been tried on iOS, and no app has run on a device (see Mobile).

A call that the platform cannot answer throws a Nativella\Exception\NativeCallException, so check Runtime::isMobile() first, or nativella_is_mobile() in Twig. A dash means that every call throws.

API Computers Phones
App Everything. hide() and show() on macOS only. No badge count, no autostart, no Directory::Desktop, no hide() and show().
Windows Everything. printToPdf() on Linux and macOS only. Windows fill the screen, so their size, position and decoration options are ignored. center(), minimize(), maximize(), unmaximize(), setAlwaysOnTop(), setFullscreen(), setProgress(), print() and printToPdf() throw.
Menus Yes. —
Tray Yes. On Linux, only its menu reports clicks; on macOS, a right click opens the menu, unreported. —
Dialogs Yes. Messages, questions and openFile(), openFiles(). openDirectory() and saveFile() throw.
Notifications Yes. A click reaches PHP on Linux and macOS. Yes, without clicks.
Clipboard Yes. Yes.
Global shortcuts Yes. On Linux, under X11 only. —
Settings Yes. Yes.
Secrets Yes. —
Timers Yes. Yes.
Child processes Yes. —
Shell Yes. openUrl() and openPath(). showInFolder() and trash() throw.
Screens Yes. Under Wayland, primary() returns null. Not tried.
System Yes. Yes.
Power Yes. —
Pages and JavaScript Yes. Yes.
Downloads Yes. —
Updates Standalone executables, and macOS apps. Linux and macOS tested. —
Phone APIs: Haptics, Geolocation, Biometrics, BarcodeScanner, Share — Android. iOS: untested.
Phone APIs: Nfc — Untested: emulators have no NFC. On iOS, reading tags needs an entitlement, which the app gets from its provisioning profile.
The camera and the microphone, for the pages, with getUserMedia() Yes, with the camera and microphone permissions. Tried on Linux. On macOS, the pages see them, but the system's question to the user is not tried yet. Yes, with the same permissions.
The location, for the pages, with navigator.geolocation With the geolocation permission. Tried on Linux only. Not tried.

What there is no API for

There is no PHP API for photos and videos, the microphone or push notifications, on any platform. Phone APIs says what a page can do in the meantime. Limitations and roadmap lists the rest.