public static Int32 DisplayNotification(Context context, String channelId, Int32 notificationId, String title, String text, IDictionary <String, String> data = null) { NotificationManagerCompat manager = NotificationManagerCompat.From(context); NotificationCompat.Builder builder = new NotificationCompat.Builder( context, channelId ?? GeneralChannelId ); if (Build.VERSION.SdkInt < BuildVersionCodes.O && channelId == GeneralChannelId) { // Вместо NotificationImportance.High в новых версиях Android. builder.SetDefaults(NotificationCompat.DefaultAll); builder.SetPriority(NotificationCompat.PriorityHigh); } notificationId = (notificationId != 0) ? notificationId : UniqueIdGenerator.GenerateId(); if (data != null && IntentUtilities.IsDataKeysCollectionValidToCreateIntent(data.Keys)) { Intent intent = IntentUtilities.CreateIntentFromData(context, data); if (intent == null) { return(-1); } builder.SetContentIntent(PendingIntent.GetActivity( context, notificationId, intent, PendingIntentFlags.OneShot )); } builder.SetContentTitle( title ?? context.Resources.GetString(Resource.String.applicationCompleteName)); builder.SetStyle(new NotificationCompat.BigTextStyle().BigText(text)).SetAutoCancel(true) .SetSmallIcon(Resource.Mipmap.notificationIcon); manager.Notify(notificationId, builder.Build()); return(notificationId); }