Firebase save data when app is in background
<p>I have a example output from the server to push notification to an app which is shown below:</p>

<pre><code>  {
    "to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
    "notification" : {
      "body" : "great match!",
      "title" : "Portugal vs. Denmark",
      "icon" : "myicon"
    },
    "data" : {
      "Nick" : "Mario",
      "Room" : "PortugalVSDenmark"
    }
  }
</code></pre>

<p>How do I store the contents in data when the app is in background as <code>onMessageReceived</code> is only triggered when the app in in foreground.</p>