Skip to content

Commit

Permalink
NotificationHelper : randomId()
Browse files Browse the repository at this point in the history
  • Loading branch information
LavishSwarnkar committed Mar 9, 2024
1 parent 3a9e44b commit 69b2418
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class NotificationHelper(
createNotificationChannel(channelId)

/* Post */
val id = Random().nextInt(30000) + 1000
val id = randomId()
val notificationManager = NotificationManagerCompat.from(context)
notificationManager.notify(
id,
Expand Down Expand Up @@ -129,6 +129,8 @@ class NotificationHelper(
.build()
}

fun randomId(): Int = Random().nextInt(30000) + 1000

fun hideNotification(
id: Int
) {
Expand Down

0 comments on commit 69b2418

Please sign in to comment.