i have a xamarin android push notification, but when i recieve the notification in some devices it remains open (the rectangle doesnt auto-dismiss) and in other devices (ej Samsumg Galaxy A5) the notification opens itself (triggers the activity on its intent without touching it), in other devices the notification works correctly.
here is the code that creates the notification
//Create notification
var notificationManager = GetSystemService(Context.NotificationService) as NotificationManager;
// Create a PendingIntent; we're only using one PendingIntent (ID = 0):
var notificationId = NotificationCount;
const int pendingIntentId = 0;
intent.SetAction(DateTime.Now.Ticks.ToString());
intent.AddFlags(ActivityFlags.ClearTop);
PendingIntent pendingIntent = PendingIntent.GetActivity(this, notificationId, intent, PendingIntentFlags.UpdateCurrent);
// Instantiate the builder and set notification elements:
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.SetContentTitle(title)
.SetAutoCancel(true)
.SetContentIntent(pendingIntent).SetAutoCancel(true)
.SetContentText(payload.Message)
.SetSmallIcon(Resource.Drawable.iconToolbarNotification)
.SetLargeIcon(BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.IconToolbar_blue))
.SetDefaults((int)NotificationDefaults.All)
.SetStyle(new NotificationCompat.BigTextStyle().BigText(payload.Message));
var fullScreenPendingIntent = PendingIntent.GetActivity(this, notificationId, intent, PendingIntentFlags.UpdateCurrent);
builder.SetFullScreenIntent(fullScreenPendingIntent, true);
Settings.NotificationBellAlert = true;
// Build the notification:
Notification notification = builder.Build();
// Publish the notification:
notificationManager.Notify(notificationId, notification);
The problem was this section of code
var fullScreenPendingIntent = PendingIntent.GetActivity(this, notificationId, intent, PendingIntentFlags.UpdateCurrent);
builder.SetFullScreenIntent(fullScreenPendingIntent, true);
thanks to this post