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 tested on, the others are not (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. | No badge count, no autostart, no Directory::Desktop. |
| Windows | Everything. printToPdf() on Linux 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. | — |
| Dialogs | Yes. | Messages, questions and openFile(), openFiles(). openDirectory() and saveFile() throw. |
| Notifications | Yes. A click reaches PHP on Linux only. | 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. | Everything but trash(). |
| Screens | Yes. Under Wayland, primary() returns null. |
Not tried. |
| System | Yes. | Yes. |
| Power | Yes. | — |
| Pages and JavaScript | Yes. | Yes. |
| Downloads | Yes. | — |
| Updates | Standalone executables. Linux tested. | — |
Phone APIs: Haptics, Geolocation, Biometrics, BarcodeScanner, Share |
— | Android. iOS: untested. |
Phone APIs: Nfc |
— | Untested: emulators have no NFC. iOS needs an entitlement nativella ios does not set. |
The camera and the microphone, for the pages, with getUserMedia() |
Yes, with the camera and microphone permissions. Tried on Linux only. |
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.