How do I auto-dismiss a specific FCM notification when the app is opened

Viewed 403

We send a push notification with FCM payload like this

{
  "to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
  "notification": {
    "title_loc_key": "title",
    "body_loc_key": "body",
    "tag": "tag",
    "click_action": "some.action.in.my.Package"
  },
  "data": {
    "type": "sometype"
  }
}

How do I clear out this notification from the tray if someone opens the app? I only want to clear this notification, not all notifications. Since it has notification key, my service instance only is notified if the message comes in with the app active.

0 Answers
Related