Use notificationID as requestcode to allow multiple android notifications

Signed-off-by: Adam <adam.feakin@gmail.com>
This commit is contained in:
Adam 2021-05-07 14:37:54 +01:00
parent f184fa0386
commit fc155f0ba8
2 changed files with 2 additions and 2 deletions

View file

@ -76,7 +76,7 @@ public class DeckApiImpl implements DeckApi {
private PendingIntent createPendingIntent(@NonNull Intent intent, @NonNull Notification notification, @NonNull User user) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(context, 0, putExtrasToIntent(intent, notification, user),
return PendingIntent.getActivity(context, notification.getNotificationId(), putExtrasToIntent(intent, notification, user),
PendingIntent.FLAG_ONE_SHOT);
}

View file

@ -156,7 +156,7 @@ class NotificationWork constructor(
}
intent.putExtra(KEY_NOTIFICATION_ACCOUNT, user.accountName)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
pendingIntent = PendingIntent.getActivity(context, notification.getNotificationId(), intent, PendingIntent.FLAG_ONE_SHOT)
}
val pushNotificationId = randomId.nextInt()