So far, we have explored features, functionalities, and so on. Now, it's the time to put all our learning into practice. In this example, we will use the blood bank project from Chapter 1, Keep It Real – Firebase Realtime Database and add the notification feature using functions. Whenever the database has a new entry, meaning whenever people add their donor details, we will get a notification of what blood group has been added.
- Go to the Realtime Database chapter code. Open it in Android Studio.
- Create the MessagingService class shown next.
- Register the service class in the manifest.
- Subscribe to the topic in the activity.
Use this code for the MessagingService class:
package com.ashok.packt.realtime.database ...