From 8ab25ce813ceea1bd08368fb31efa3581f42c389 Mon Sep 17 00:00:00 2001 From: Jenna Antilla <46546946+jennantilla@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:20:24 -0700 Subject: [PATCH] set inAppMessageIdShowing back to null after display Remove return if lifecycleCallback.hasSubscribers is false --- .../inAppMessages/internal/InAppMessagesManager.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.kt b/OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.kt index a85d8b62c..debabbae4 100644 --- a/OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.kt +++ b/OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/InAppMessagesManager.kt @@ -393,11 +393,9 @@ internal class InAppMessagesManager( } // fire the external callback - if (!_lifecycleCallback.hasSubscribers) { - Logging.verbose("InAppMessagesManager.messageWasDismissed: inAppMessageLifecycleHandler is null") - return + if (_lifecycleCallback.hasSubscribers) { + _lifecycleCallback.fireOnMain { it.onDidDismiss(InAppMessageLifecycleEvent(message)) } } - _lifecycleCallback.fireOnMain { it.onDidDismiss(InAppMessageLifecycleEvent(message)) } _state.inAppMessageIdShowing = null