69.6 Creating and Issuing a Notification
Notifications are created using the Notification.Builder class and must contain an icon, title and content. Open the MainActivity.kt file and implement the sendNotification() method as follows to build a basic notification:
.
.
import android.app.Notification
import android.view.View
.
.
fun sendNotification(view: View) {
val channelID = "com.ebookfrenzy.notifydemo.news"
val notification = Notification.Builder(this@MainActivity,
channelID)
.setContentTitle("Example Notification")
.setContentText("This is an example notification.")
...