native.getProperty()

Type Function
Library native.*
Revision Release 2024.3703
Keywords native property
See also native.setProperty()

Overview

Gets the value of a platform-specific property.

Syntax

native.getProperty( key )
key (required)

String. The property whose value will be retrieved. Supported keys include:

  • "androidSystemUiVisibility" — Android and Fire OS only.
  • "applicationIconBadgeNumber" — iOS only.
  • "applicationSupportsShakeToEdit" — iOS only.
  • "networkActivityIndicatorVisible" — iOS only.
  • "prefersHomeIndicatorAutoHidden" — iOS only.
  • "windowMode" — Applies only to macOS desktop and Win32 desktop apps.
  • "windowTitleText" — Applies only to macOS desktop and Win32 desktop apps.
  • "mouseCursorVisible" — Applies only to macOS desktop and Win32 desktop apps.
  • "preferredScreenEdgesDeferringSystemGestures" — iOS only.

Example

local badge_num = native.getProperty( "applicationIconBadgeNumber" )
badge_num = badge_num + 1

native.setProperty( "applicationIconBadgeNumber", badge_num )