'Flutter iOS Terminates State get data from firebase push notification

How we can get the data of push notification to save it in our local database using flutter iOS while in terminated state?

We are using firebase admin-sdk to send push notification using the send to device function

we are using this payload

const payload = {
  notification: {
    title: title,
    body: notification.message,
    sound: "default",
  },
  data: {
    click_action: "FLUTTER_NOTIFICATION_CLICK",
    title: title,
    message: notification.message,
  }
};

with message options

{
    contentAvailable: true,
    priority: 'high'
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source