title: Firebase Cloud Messaging - Type mismatch: inferred type is Message but RemoteMessage was expected
body: <p>I'm following a tutorial for Cloud Messaging Messaging here <a href="https://firebase.google.com/docs/cloud-messaging/send-message#send_messages_to_specific_devices" rel="nofollow noreferrer">https://firebase.google.com/docs/cloud-messaging/send-message#send_messages_to_specific_devices</a> and I'm having trouble constructing the Message object. </p>
  
  <p>When I try to send the message using the code below and run my app I am receiving the following compile error "Type mismatch: inferred type is Message but RemoteMessage was expected". It is telling me to pass a RemoteMessage instead of a Message but the send() parameter clearly states otherwise.</p>
  
  <p>I'm also using the Firebase Admin SDK and finding it difficult to send a notification to a device programatically instead of the console notification composer. I really appreciate any help in advance!</p>
  
  <pre><code>     // See documentation on defining a message payload.
      val message: Message = Message.builder()
          .putData("score", "850")
          .putData("time", "2:45")
          .setTopic(topic)
          .build()
  
      // Send a message to the devices subscribed to the provided topic.
      FirebaseMessaging.getInstance().send(message)
  </code></pre>