defaultPresentSound property

bool defaultPresentSound
final

Configures the default setting on if a sound should be played when a notification is triggered while app is in the foreground.

Corresponds to https://developer.apple.com/documentation/usernotifications/unnotificationpresentationoptions/1649521-sound

Default value is true.

If this is set to false to indicate that the notification shouldn't play a sound in the foreground then note that for consistency, the notification won't play a sound when the app is in the background. If the intention in this scenario is to have the app also play the default notification sound whilst the app is in the background as well, then the DarwinNotificationDetails.sound should be set to an arbitrary value (e.g. empty string) that doesn't match a custom sound file. This way the platform fails to find a custom sound file to fallback to the default notification sound.

On iOS, this property is only applicable to iOS 10 or newer. On macOS, this property is only applicable to macOS 10.14 or newer.

Implementation

final bool defaultPresentSound;