Changes

Jump to: navigation, search
no edit summary
Figure 32-2
<htmlet>firebase_android</htmlet>
== Obtaining the Registration Token ==
}
</pre>
<htmlet>firebase_android</htmlet>
When the onMessageReceived() method is called, it is passed as an argument a RemoteMessage object containing the details of a Firebase cloud message. The only kind of message the client app expects to receive contains message text from another user. This value is contained within the data payload assigned to the “message” key. The code in the onMessageReceived() method verifies that the payload contains data, extracts the message text and then passes it to a method named showMessage() which displays the message text in a Toast popup. Since displaying a toast message is a UI operation and this service is not running on the main UI thread a reference to the main UI thread is obtained and the Toast message displayed using that thread.
}
</pre>
<htmlet>firebase_android</htmlet>
== Sending the Upstream Message ==

Navigation menu