Use a separate notification id for failure notifications
This way failure notifications won't overwrite the existing chat notifications (if there are any) as they also use thread id as notification id
This commit is contained in:
parent
0523d93243
commit
35e9141888
|
@ -119,7 +119,7 @@ class NotificationHelper(private val context: Context) {
|
||||||
fun showSendingFailedNotification(recipientName: String, threadId: Long) {
|
fun showSendingFailedNotification(recipientName: String, threadId: Long) {
|
||||||
maybeCreateChannel(name = context.getString(R.string.message_not_sent_short))
|
maybeCreateChannel(name = context.getString(R.string.message_not_sent_short))
|
||||||
|
|
||||||
val notificationId = threadId.hashCode()
|
val notificationId = generateRandomId().hashCode()
|
||||||
val intent = Intent(context, ThreadActivity::class.java).apply {
|
val intent = Intent(context, ThreadActivity::class.java).apply {
|
||||||
putExtra(THREAD_ID, threadId)
|
putExtra(THREAD_ID, threadId)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue