onBackgroundEvent
API used to handle events when the application is in a background state.
onBackgroundEvent(observer: (event: Event) => Promise<void>): void;
Applications in a background state will use an event handler registered by this API method to send events. The handler must return a Promise once complete and only a single event handler can be registered for the application.
View the Background events documentation for more information and example usage.
To listen to foreground events, see the onForegroundEvent
documentation.
Property | Description | Optional |
---|---|---|
observer | A Function which returns a Promise, called on a new event when the application is in a background state. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License and code samples are licensed under the Apache 2.0 License.
All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.