title: Flutter Firebase: Send notifications from cloud functions
body: <p>I have a collection, 'users', where each document holds an int votesUseable. I have a cloud function setup to reset all users votes everyday:</p>
  <pre><code>export const resetDay = functions.pubsub.schedule(&quot;00 22 * * *&quot;)
      .timeZone(&quot;America/New_York&quot;)
      .onRun(async () =&gt; {
        await admin.firestore().collection(&quot;users&quot;)
            .get().then((querySnapshot) =&gt; {
              querySnapshot.forEach(async (doc) =&gt; {
                // eslint-disable-next-line max-len
                await doc.ref.update({&quot;votesUsable&quot;: 2});
              });
            })
            .catch((error) =&gt; {
              console.log(&quot;Error getting documents: &quot;, error);
            });
        return null;
      });
  </code></pre>
  <p>Id like to add a push notification sent to each user, however I am having trouble implementing it. I am trying to follow the documentation example:
  <a href="https://github.com/firebase/functions-samples/blob/main/fcm-notifications/functions/index.js" rel="nofollow noreferrer">https://github.com/firebase/functions-samples/blob/main/fcm-notifications/functions/index.js</a>,
  however it feels very different from the way I implemented the function. Does anyone have any ideas? Im also using this with a flutter app, if that makes a difference. Thank you!</p>