public static async void ShowLocalNot(LocalNot not, Context context = null) { var cc = context ?? Application.Context; var builder = new Notification.Builder(cc); builder.SetContentTitle(not.title); bool containsMultiLine = not.body.Contains("\n"); if (Build.VERSION.SdkInt < BuildVersionCodes.O || !containsMultiLine) { builder.SetContentText(not.body); } builder.SetSmallIcon(not.smallIcon); builder.SetAutoCancel(not.autoCancel); builder.SetOngoing(not.onGoing); if (not.progress != -1) { builder.SetProgress(100, not.progress, false); } builder.SetVisibility(NotificationVisibility.Public); builder.SetOnlyAlertOnce(true); if (Build.VERSION.SdkInt >= BuildVersionCodes.O) { var channelId = $"{cc.PackageName}.general"; var channel = new NotificationChannel(channelId, "General", (NotificationImportance)not.notificationImportance); NotManager.CreateNotificationChannel(channel); builder.SetChannelId(channelId); if (not.bigIcon != null) { if (not.bigIcon != "") { var bitmap = await GetImageBitmapFromUrl(not.bigIcon); if (bitmap != null) { builder.SetLargeIcon(bitmap); if (not.mediaStyle) { builder.SetStyle(new Notification.MediaStyle()); // NICER IMAGE } } } } if (containsMultiLine) { var b = new Notification.BigTextStyle(); b.BigText(not.body); builder.SetStyle(b); } if (not.actions.Count > 0) { List <Notification.Action> actions = new List <Notification.Action>(); for (int i = 0; i < not.actions.Count; i++) { var _resultIntent = new Intent(context, typeof(MainIntentService)); _resultIntent.PutExtra("data", not.actions[i].action); var pending = PendingIntent.GetService(context, 3337 + i + not.id, _resultIntent, PendingIntentFlags.UpdateCurrent ); actions.Add(new Notification.Action(not.actions[i].sprite, not.actions[i].name, pending)); } builder.SetActions(actions.ToArray()); } } builder.SetShowWhen(not.showWhen); if (not.when != null) { builder.SetWhen(CurrentTimeMillis((DateTime)not.when)); } var stackBuilder = Android.Support.V4.App.TaskStackBuilder.Create(cc); var resultIntent = GetLauncherActivity(cc); if (not.data != "") { resultIntent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask); var _data = Android.Net.Uri.Parse(not.data); //"cloudstreamforms:tt0371746Name=Iron man=EndAll"); resultIntent.SetData(_data); stackBuilder.AddNextIntent(resultIntent); var resultPendingIntent = stackBuilder.GetPendingIntent(not.id, (int)PendingIntentFlags.UpdateCurrent); builder.SetContentIntent(resultPendingIntent); } else { stackBuilder.AddNextIntent(resultIntent); builder.SetContentIntent(GetCurrentPending()); } try { NotManager.Notify(not.id, builder.Build()); } catch { } }