title: How to use FCM in react native chat app to send notifications on receiving messages
body: <p>I have a chat app and I have implemented FCM and I can receive notifications from firebase console. How can I set it so every time user receive a new message it generates notification?
  This is how I'm getting my chats.</p>
  <pre><code>  const getLiveUpdates = () =&gt; {
      let merged_uid = uid_merger(current_user.id, chat_user.uid);
      database()
        .ref('chats/' + merged_uid)
        .orderByChild('/sendTime')
        .on('value', (msgs) =&gt; {
          if (msgs.val()) {
            setChats(Object.values(msgs.val()));
          } else {
            setChats([]);
          }
        });
    };
  </code></pre>