native.requestExit()

Type Function
Library native.*
Return value none
Revision Release 2024.3703
Keywords requestExit, exit
See also os.exit()

Overview

On Android, this closes the application window gracefully without terminating the process. On macOS and Windows, this closes the application.

It is highly recommended that you call this function instead of os.exit(). The os.exit() function call terminates the application process immediately, which can be interpretted by an app reviewer as a crash. It would also clear all scheduled notifications and notification in the status bar on Android, which require the application process to be alive in the background to manage them.

Syntax

native.requestExit()

Gotchas