title: Sending Push Notifications using expo + firebase
body: <p>I am trying to send push notifications using expo tokens and firebase.
  When I am trying to test the expo tokens by sending notification by expo notification tool it works fine.
  But when I use firebase to check the push notification it does not works.
  Here is my firebase function <code>index.js</code> file.</p>
  
  <pre><code>const functions = require('firebase-functions');
  var fetch = require('node-fetch')
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  exports.sendPushNotification = functions.database.ref('/UserOrders/').onCreate((snap, context) =&gt; {
      const root = snap.data.ref.root
  
      var messages = []
  
      return root.child('/PushNotification').once('value').then(function (snapshot) {
          snapshot.forEach(function (childSnapshot) {
              var expoToken = childSnapshot.val().expoToken;
              messages.push({
                  "to": expoToken,
                  "sound": "default",
                  "body": "New enquiry. Please see!!"
              });
          });
          return Promise.all(messages)
      }).then(messages =&gt; {
          console.log('messages', messages)
          fetch('https://exp.host/--/api/v2/push/send', {
              method: 'POST',
              headers: {
                  'Accept': 'application/json',
                  'Content-Type': 'application/json',
              },
              body: JSON.stringify(messages)
          });
      }).catch(reason =&gt; {
          console.log('reason failure', reason)
      })
  });
  </code></pre>