Skip to content

Commit eee4d7b

Browse files
committed
read the discard property of the willDisplayEvent to skip waiting on display
1 parent 40cd781 commit eee4d7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/generation/impl/NotificationGenerationProcessor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ internal class NotificationGenerationProcessor(
105105
GlobalScope.launch(Dispatchers.IO) {
106106
_lifecycleService.externalNotificationWillShowInForeground(notificationWillDisplayEvent)
107107

108-
if (notificationWillDisplayEvent.isPreventDefault) {
108+
if (notificationWillDisplayEvent.discard) {
109+
wantsToDisplay = false;
110+
} else if (notificationWillDisplayEvent.isPreventDefault) {
109111
// wait on display waiter. If the caller calls `display` on the notification,
110112
// we will exit `waitForWake` and set `wantsToDisplay` to true. If the callback
111113
// never calls `display` we will timeout and never set `wantsToDisplay` to true.

0 commit comments

Comments
 (0)