private void ShowNow(NotificationRequest request) { Cancel(request.NotificationId); if (string.IsNullOrWhiteSpace(request.Android.ChannelName)) { request.Android.ChannelName = "General"; } var channelId = NotificationCenter.GetChannelId(request.Android.ChannelName); var builder = new NotificationCompat.Builder(Application.Context, channelId); builder.SetContentTitle(request.Title); builder.SetContentText(request.Description); builder.SetStyle(new NotificationCompat.BigTextStyle().BigText(request.Description)); builder.SetNumber(request.BadgeNumber); builder.SetAutoCancel(request.Android.AutoCancel); if (Build.VERSION.SdkInt < BuildVersionCodes.O) { builder.SetPriority((int)request.Android.Priority); var soundUri = NotificationCenter.GetSoundUri(request.Sound); if (soundUri != null) { builder.SetSound(soundUri); } } if (request.Android.Color.HasValue) { builder.SetColor(request.Android.Color.Value); } builder.SetSmallIcon(GetIcon(request.Android.IconName)); if (request.Android.TimeoutAfter.HasValue) { builder.SetTimeoutAfter((long)request.Android.TimeoutAfter.Value.TotalMilliseconds); } var notificationIntent = Application.Context.PackageManager.GetLaunchIntentForPackage(Application.Context.PackageName); notificationIntent.SetFlags(ActivityFlags.SingleTop); notificationIntent.PutExtra(NotificationCenter.ExtraReturnDataAndroid, request.ReturningData); var pendingIntent = PendingIntent.GetActivity(Application.Context, 0, notificationIntent, PendingIntentFlags.UpdateCurrent); builder.SetContentIntent(pendingIntent); var notification = builder.Build(); if (request.Android.LedColor.HasValue) { notification.LedARGB = request.Android.LedColor.Value; } if (Build.VERSION.SdkInt < BuildVersionCodes.O && string.IsNullOrWhiteSpace(request.Sound) == false) { notification.Defaults = NotificationDefaults.All; } _notificationManager.Notify(request.NotificationId, notification); }