Hello, I have a really strange push notification b...
# android
b
Hello, I have a really strange push notification bug in my app. A user can get push notifications when a news for him is available. In this case when the user clicks the push notification he should get to this news. so i create the pending intent like this because i want to open the news activity and when the user clicks back i want him to get back to the home activity:
Copy code
val contentIntent = TaskStackBuilder
   .create(context)
   .addNextIntent(homeIntent)
   .addNextIntent(newsIntent)
   .getPendingIntent(
      0,
      PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
   )

NotificationCompat.Builder()
   .setContentIntent(contentIntent)
This works fine if i click the notification directly when i receive it. BUT: If I don´t click the notification directly and wait a few hours or even click it on the next day it only opens the app and don´t forward to the News Activity. This only happens for the first push I click e.g. on the next day. If I have two or more pushes from yesterday to news, only the first one I click is not working but the others are. I don´t even have an idea how to debug this behaviour. Can you please help me what I am doing wrong or how i can reproduce / debug this? Thanks in advance
not kotlin but kotlin colored 3
c
Image from iOS.jpg