registerForegroundService

Android Only

API used to register a foreground service on Android devices.



registerForegroundService(task: ForegroundServiceTask): void;

This method is used to register a long running task which can be used with Foreground Service notifications.

Only a single foreground service can exist for the application, and calling this method more than once will update the existing task runner.

View the Foreground Service documentation for more information.


PropertyDescriptionOptional
task

The runner function which runs for the duration of the service's lifetime.


Copyright 2020 - 2021 © Invertase Limited

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.