setForegroundNotificationPresentationOptions method

Future<void> setForegroundNotificationPresentationOptions({
  1. bool alert = false,
  2. bool badge = false,
  3. bool sound = false,
})

Sets the presentation options for Apple notifications when received in the foreground.

By default, on Apple devices notification messages are only shown when the application is in the background or terminated. Calling this method updates these options to allow customizing notification presentation behavior whilst the application is in the foreground.

Important: The requested permissions and those set by the user take priority over these settings.

  • alert Causes a notification message to display in the foreground, overlaying the current application (heads up mode).
  • badge The application badge count will be updated if the application is in the foreground.
  • sound The device will trigger a sound if the application is in the foreground.

If all arguments are false or are omitted, a notification will not be displayed in the foreground, however you will still receive events relating to the notification.

Implementation

Future<void> setForegroundNotificationPresentationOptions({
  bool alert = false,
  bool badge = false,
  bool sound = false,
}) {
  return _delegate.setForegroundNotificationPresentationOptions(
    alert: alert,
    badge: badge,
    sound: sound,
  );
}