title: TypeError: admin.messaging.sendToDevice is not a function , using firebase functions
body: <p>While using the below function I am getting to send device to device notification I am getting this error in firebase cloud functions for messaging </p>
  
  <blockquote>
    <p>TypeError: admin.messaging.sendToDevice is not a function</p>
  </blockquote>
  
  <pre><code>return admin.messaging.sendToDevice(to_token_id,payload).then(result=&gt;{
  
              console.log("Notification Sent Successful");
              return null;
          });
  </code></pre>
  
  <p>Is the above method deprecated?
  If so, then what is the new one?
  The above firebase cloud function is written in javascript.</p>