Skip to content

Commit

Permalink
Ensure InAppMessagesManager will capture/send impressions even if the…
Browse files Browse the repository at this point in the history
…re is no IAM lifecycle listener set by the app. (#1980)

* Ensure InAppMessagesManager will capture/send impressions even if there is no IAM lifecycle listener set by the app.

* Flip the logic of if/else check
  • Loading branch information
brismithers committed Feb 2, 2024
1 parent ae7fa7c commit 2072eac
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,12 @@ internal class InAppMessagesManager(
}

override fun onMessageWasDisplayed(message: InAppMessage) {
if (!lifecycleCallback.hasSubscribers) {
if (lifecycleCallback.hasSubscribers) {
lifecycleCallback.fireOnMain { it.onDidDisplay(InAppMessageLifecycleEvent(message)) }
}
else {
Logging.verbose("InAppMessagesManager.onMessageWasDisplayed: inAppMessageLifecycleHandler is null")
return
}
lifecycleCallback.fireOnMain { it.onDidDisplay(InAppMessageLifecycleEvent(message)) }

if (message.isPreview) {
return
Expand Down

0 comments on commit 2072eac

Please sign in to comment.