title: Flutter: Firebase Pushnotification On Data Change
body: <p>After getting the comment, i have deployed this folowing code to my firebase project and it was successfully deploed!.But there is no notifications been send to me.
  Please check my Firebase Realtime database Screenshot here for better understanding. </p>
  
  <p><strong>[ITS SOLVED NOW:IT WILL SEND NOTIFICATIONS TO ONLY ONE ID ie My Admin Device]</strong></p>
  
  <p>WORKING CODE: </p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firbase);
  exports.codeformypeople = functions.database.ref('items/{id}').onWrite(evt =&gt; {
  
  const payload = {
  notification: { title: 'New Customer Requested', body: 'Touch to Open The App', badge: '1', sound: 'default', }
  };
  const token ="Lsn-bHfBWC6igTfWQ1-h7GoFMxaDWayKIpWCrzC";//replace with ur token
  
  if (token) {
  console.log('Toke is availabel .');
  return admin.messaging().sendToDevice(token, payload);
  } else {
  console.log('token error');
  }
  });
  </code></pre>
  
  <p>[<img src="https://i.stack.imgur.com/3PfDM.png" alt="Mydatabase Structure[1]"></p>
  
  <p><strong>SEE THIS <a href="https://www.youtube.com/watch?v=HfSxWshEzUM" rel="nofollow noreferrer">VIDEO LINK</a> FOR MORE DETAILS</strong></p>
  
  <p>note:If your app is opened and minmized then it will show notification,but if the app is opened and you are using,or if the app is terminated force close then it will not work!!</p>