When the notification is recieved following code is handling the message:
private void SendNotification(string message)
{
var intent = new Intent(this, t
With the newer Android APIs, they now require a notification channel (NotificationChannel) to be used. You can do fairly easily by using NotificationCompat from the Android support library and only creating the channel if you are on Oreo or later.
using (var notificationManager = NotificationManager.FromContext(ApplicationContext))
{
var channelName = GetText(Resource.String.notificationChannelNormal);
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
{
NotificationChannel channel = null;
#if !DEBUG
channel = notificationManager.GetNotificationChannel(channelName);
#endif
if (channel == null || resetChannel)
{
channel = new NotificationChannel(channelName, channelName, NotificationImportance.Low)
{
LockscreenVisibility = NotificationVisibility.Public
};
channel.SetShowBadge(true);
notificationManager.CreateNotificationChannel(channel);
}
channel.Dispose();
}
Bitmap bitMap = BitmapFactory.DecodeResource(Resources, Resource.Drawable.ic_launcher);
var notificationBuilder = new NotificationCompat.Builder(ApplicationContext)
.SetContentTitle(title)
.SetContentText(message)
.SetSmallIcon(Resource.Drawable.ic_stat_notification_network_locked)
.SetLargeIcon(bitMap)
.SetShowWhen(false)
.SetChannelId(channelName)
.SetContentIntent(pendingIntent);
return notificationBuilder.Build();
}