Native App Event Listener
Overview
The NativeAppEventListener is a pluggable Mendix Native widget designed to respond to app lifecycle changes, such as transitioning between active, inactive, and background states. It provides hooks to trigger actions during these transitions and includes a built-in workaround for iOS font scaling issues.
Documentation
Typical usage scenario
We can trigger nanoflow when app goes in inactive, background, and when app comes in active/foreground state we can call nanoflow.
Features and limitations
🔧 Properties
Delay (delay)
-
Type: Integer
-
Default: 600
-
Description:The number of seconds to wait before triggering the onResume action after the app returns from the background or inactive state.(Example: 60 seconds = 1 minute)
onResume
-
Type: Action
-
Description:A nanoflow or microflow that will be executed when the app becomes active again after being in the background or inactive state, and after the specified delay.
onExit
-
Type: Action
-
Description:A nanoflow or microflow that is triggered when the app transitions to the background or becomes inactive. This is useful for saving state, stopping timers, or managing session data.
Is Font Reload (fontReload)
-
Type: Boolean
-
Default: false
-
Description:Set this to true to enable iOS-specific behavior for handling system font size changes while the app is in the background.When the app returns to the foreground, the widget compares the previously saved font scale with the current one. If a change is detected and the platform is iOS, it triggers a full app reload via mx.reload() to apply the updated font scale.