Host.systemBackExit
luastra/hostHost.systemBackExit(intentId: number): RequestId
Acknowledges a root-level system-Back intent by requesting the host's admitted exit behavior. The intent ID correlates the decision with the exact pending Back event.
Before you use it
Add luastra/host to this module's dependencies in luastra.json, then import it with require("luastra/host"). Declare navigation.history in luastra.json. Save the returned RequestId with its purpose and implement app.resolve.
How it fits
The function starts an asynchronous host request and returns immediately. app.resolve receives its success payload or stable failure code; availability and permission can vary by host.
When to use it
Use Host.systemBackExit only when no modal, local route, or history entry can consume Back and the platform permits root exit. Desktop and web hosts may interpret this boundary differently.
Parameters
| Parameter | Type / values | Description |
|---|---|---|
| intentId | number | ID of the pending root-level system-Back intent requesting exit. |
Returns
RequestId — an opaque request identifier used to correlate the asynchronous completion in app.resolve.
What happens next
A RequestId now, followed later by one matching app.resolve completion.
Failures and fixes
Undeclared capability, unavailable host support, denied permission, invalid input, deadline, network, or internal failure reaches the bounded failure path. Public completion codes are CANCELLED, DEADLINE, FORBIDDEN, INTERNAL, NETWORK, UNAUTHORIZED, and VALIDATION.
Availability
Public-source alpha capability API in 0.5.0-alpha; verify each claimed host independently.
Focused example
local Host = require("luastra/host")
Host.systemBackExit(intentId)Continue with a complete recipe
This checked recipe uses Host.systemBackExit inside complete authored files with the required manifest, test, and run steps.
Open synchronize Browser and system Back recipe