Handling app focus.
The AppFocusService is used for apps that require a high degree of user interactivity, like a game when you need to know when to pause your app when a notification covers your app window.
void app_focus_service_subscribe | ( | AppFocusHandler | handler) |
Subscribe to the focus event service. Once subscribed, the handler gets called every time the app focus changes.
handler | A callback to be executed on in-focus events. |
void app_focus_service_unsubscribe | ( | void | ) |
Unscribe from the focus event service. Once unsubscribed, the previously registered handler will no longer be called.
typedef void(* AppFocusHandler)(bool in_focus) |
Callback type for focus events.
in_focus | True if the app is in focus, false otherwise. |