🥄
One Library
  • 🤖onelib
  • 🏡Home
    • Overview
    • Setup Project
    • What's New
  • ☀️Fundamental
    • Basic Android
    • Data Flow
    • Dependency Injection
      • Hilt
      • Koin
  • 📿Layers
    • Data Layer
    • Domain Layer
    • Presentation Layer
  • 🪶Features
    • Views
      • Activity
      • Fragment
      • Bottom Sheet
      • Dialog
    • Adapters
      • Recycler Adapter
      • Filterable Adapter
      • Paging Adapter
      • Selectable Adapter
      • ViewPager Adapter
    • Firebase
      • One Firebase Auth
      • One Firebase Firestore
      • One Firebase Realtime
      • One Firebase Storage
    • Extension Functions
      • Any
      • Common
      • Context
      • Edittext
      • Image View
      • LiveData
      • OneMap
      • State Flow (Jetpack Compose)
      • View
    • Notification
    • One State View
    • Local Database
    • Permission
    • Validation
      • Passive Validator
      • Reactive Validator
      • Extension Validation
Powered by GitBook
On this page
  1. Features

Notification

Last updated 1 year ago

In Android development, a notification is a message that Android apps can display to users outside of the app's normal UI. They provide a way to notify users about events, updates, or other actions that require their attention, even when the app is not running in the foreground. Notifications are an essential part of creating a good user experience, allowing users to stay informed and engaged with the app.

Example

showNotification(
    context = this,
    title = "This is title",
    body = "This is body",
    intent = MainActivity.pendingIntent(this)
)

And you can use notification with image

showNotification(
    context = this,
    title = "This is title",
    body = "This is body",
    intent = MainActivity.pendingIntent(this),
    imgUrl = "https://fastly.picsum.photos/id/938/200/300.jpg?hmac=MVXKrDXBUPK5fv_Ev3FTdCFeYf9rvJE2Tz9xynjeelM"
)

Make sure permission of notification is enable

And this is the result

🪶