title: Notifications are not pushed to android device
body: <p><strong>Database:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rMiHn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rMiHn.png" alt="enter image description here"></a></p>
  
  <p>i`m a beginner so I followed a guide to send notification to user on my database that builded at firebase platform.</p>
  
  <p>this is my js:</p>
  
  <pre><code>/*
   * Functions SDK : is required to work with firebase functions.
   * Admin SDK : is required to send Notification using functions.
   */
  
  'use strict'
  
  const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  
  /*
   * 'OnWrite' works as 'addValueEventListener' for android. It will fire the function
   * everytime there is some item added, removed or changed from the provided 'database.ref'
   * 'sendNotification' is the name of the function, which can be changed according to
   * your requirement
   */
  
  exports.sendNotification = functions.database.ref('/notifications/{user_id}/{notification_id}').onWrite((data, context) =&gt; {
  
  
    /*
     * You can store values as variables from the 'database.ref'
     * Just like here, I've done for 'user_id' and 'notification'
     */
  
    const user_id = context.params.user_id;
    const notification_id = context.params.notification_id;
  
    console.log('We have a notification to send to : ', user_id);
  
    if(!data.after.val()) {
      return console.log('A notification has been deleted from database', notification_id);
    }
  
    const deviceToken = admin.database().ref(`/Users/${user_id}/device_token`).once('value');
    return deviceToken.then(result =&gt; {
  
      const token_id = result.val();
  
  
      const payload = {
        notification: {
          title : "friend request",
          body : "you`ve recived a new freind request",
          icon: "default"
        }
      };
  
      return admin.messaging().sendToDevice(token_id, payload).then(response =&gt; {
        return console.log("this was the notification feature");
      });
  
    });
  
  });
  </code></pre>
  
  <p>i dont get any errors but the notifications are not displayed on the mobile with this </p>
  
  <blockquote>
    <p>id: NcTLLLKXf5grdkMTxdRzCihgJjE2.</p>
  </blockquote>