For floating notification
, you should change Notification priority or NotificationChannel importance.
Android 5.0 - Android 7.1
Set notification priority to NotificationPriority.High
or NotificationPriority.Max
.
builder.SetPriority((int)NotificationPriority.High)
Set ringtone and vibrations. You can use SetDefaults.
// Turn on sound if the sound switch is on:
notification.Defaults |= NotificationDefaults.Sound;
// Turn on vibrate if the sound switch is on:
notification.Defaults |= NotificationDefaults.Vibrate;
Android 8.0 and higher
Set notification channel priority to NotificationImportance.High or NotificationImportance.Max.
var channel = new NotificationChannel(CHANNEL_ID1, name, NotificationImportance.Max)
{
Description = description
};
For lock notifications
, you could set the Visibility.
Beginning with Android 5.0, the visibility setting is available to control how much notification content appears on the secure lock screen.
NotificationVisibility.Public
– The full content of the notification
is displayed on the secure lock screen.
NotificationVisibility.Private
– Only essential information is displayed on the secure lock screen (such as the notification icon and the name of the app that posted it), but the rest of the notification's details are hidden. All notifications default to NotificationVisibility.Private.