Hi I am using Push Notification Plugin for Xamarin for implementing push notification in my app and I am receiving push notifications (Using GCM) but the problem is the push notifications I sent to the device are being replaced when I sent a new one and that is not the expected behavior, I want to show all the notifications received, This is how I configured my android app
public override void OnCreate()
{
base.OnCreate();
AppContext = this.ApplicationContext;
CrossPushNotification.NotificationContentTextKey = "message";
CrossPushNotification.NotificationContentTitleKey = "contentTitle";
CrossPushNotification.NotificationContentDataKey = "data";
CrossPushNotification.Initialize<CrossPushNotificationListener>("MYANDROIDSENDERID");
//This service will keep your app receiving push even when closed.
CrossPushNotification.Current.Register();
StartPushService();
RegisterActivityLifecycleCallbacks(this);
}
public static void StartPushService()
{
AppContext.StartService(new Intent(AppContext, typeof(PushNotificationService)));
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat)
{
Random rnd = new Random();
// Publish the notification:
PendingIntent pintent = PendingIntent.GetService(AppContext,0, new Intent(AppContext, typeof(PushNotificationService)),0);
AlarmManager alarm = (AlarmManager)AppContext.GetSystemService(Context.AlarmService);
alarm.Cancel(pintent);
}
}
What am I missing ?