smallIcon property

String? smallIcon
getter/setter pair

Configure the small icon of the persistent notification in the Notification Bar when running with Config.foregroundService true

When running the service with Config.foregroundService: true, Android requires a persistent notification in the Notification Bar. This allows you customize that icon. Defaults to your application icon.

⚠️ Warning:

  • You must specify the type (drawable|mipmap) of resource you wish to use in the following format: {type}/icon_name
  • Do not append the file-extension (eg: .png)

Example

// 1. drawable
BackgroundGeolocation.ready(Config(
  notification: Notification(
    smallIcon: "drawable/my_custom_notification_small_icon"
  )
));

// 2. mipmap
BackgroundGeolocation.ready(Config(
  notification: Notification(
    smallIcon: "mipmap/my_custom_notification_small_icon"
  }
});

ℹ️ See also:

Implementation

String? smallIcon;