[Android only] The Android operating system requires a persistent notification when running a foreground service.
Customize the notification channel ID.
NOTE: It is not typically required to change this. Typical use-cases are for users who use an existing Android foreground-service who wish the SDK to share an existing notification and channel.
Configure the name of the plugin's notification-channel used to display the Config.foregroundService notification.
Configure the color of the persistent notification icon in the Notification Bar when running with Config.foregroundService
Configure the large icon of the persistent notification in the Notification Bar when running with Config.foregroundService
Specifies the name of your custom Android Layout XML file.
ℹ️ See Android Custom Notification Layout for setup instructions.
Even if you have no experience with Android Layouts, it doesn't take much to figure out the basics. You'll mostly be adding
<ImageView /> and
<Button /> elements. The key thing to be aware of is the
android:id of these elements and how these are referenced from
BackgroundGeolocation.notification configuration: your
android:id must be prefixed with the word
notificationText). There is one exception:
applicationName, which the plugin will automatically render your Android application name.
When BackgroundGeolocation renders your custom notification layout, it will be querying for the following elements addressed by their
android:id. When found, their content will be updated from the corresponding "Data-source":
||Application name from
When running the service with foregroundService: true, Android requires a persistent notification in the Notification Bar. This will control the priority of that notification as well as the position of the notificaiton-bar icon.
notificationPriority values defined as static constants upon the BackgroundGeolocation object:
|BackgroundGeolocation.NOTIFICATION_PRIORITY_DEFAULT||Notification weighted to top of list; notification-bar icon weighted left|
|BackgroundGeolocation.NOTIFICATION_PRIORITY_HIGH||Notification strongly weighted to top of list; notification-bar icon strongly weighted to left|
|BackgroundGeolocation.NOTIFICATION_PRIORITY_LOW||Notification weighted to bottom of list; notification-bar icon weighted right|
|BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN||Notification strongly weighted to bottom of list; notification-bar icon hidden|
Configure the small icon of the persistent notification in the Notification Bar when running with Config.foregroundService
Configure the Android Foreground Service icon and notification to be displayed always. Defaults to
The default behaviour is for the notification to be shown only while the SDK detects the device to be moving. Some developers desire to provide full-disclosure to their users when the SDK has been enabled.
Configure the text of the persistent notification in the Notification Bar when running with Config.foregroundService
Configure the title of the persistent notification in the Notification Bar when running with Config.foregroundService
Generated using TypeDoc