Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
dependencies {
implementation 'com.github.tusharvohra:NotifMan:v1.0.0'
}
<dependency>
<groupId>com.github.tusharvohra</groupId>
<artifactId>NotifMan</artifactId>
<version>v1.0.0</version>
</dependency>
- Initialize an instance of the NotificationManager.Builder() by passing the context,your notification channel ID and notification channel name
- Use the various methods to create and cusomize your notification
- Call .build() to return a notification instance example:This code will return a notification type variable with a title and content-
val notification = NotificationManager.Builder(this, "Notification_Channel_Id", "Notification_Channel_Name)
.notificationTitle("Notification Title")
.notificationContent("Notification Content")
.smallIcon(R.drawable.ic_notification)
.build()
You can also use it to create other styles of notifications like BigPicture style and BigText style.