From 9d099bc62145b9c3c71de33042f142821446f914 Mon Sep 17 00:00:00 2001 From: Nan Date: Mon, 25 Nov 2024 14:11:57 -0800 Subject: [PATCH] Don't evaluate in app messages when paused * Evaluating IAMs while paused will lead to inaccuracies once IAMs are unpaused. * For example, duration-since-last IAMs will be evaluated incorrectly and then queue for display once unpaused. * When IAMs are unpaused, IAM evaluation is re-triggered anyway and will queue the messages for display at that time. --- .../OneSignalInAppMessages/Controller/OSMessagingController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller/OSMessagingController.m b/iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller/OSMessagingController.m index 4fb651db5..157efafb1 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller/OSMessagingController.m +++ b/iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller/OSMessagingController.m @@ -683,6 +683,10 @@ - (void)messageViewImpressionRequest:(OSInAppMessageInternal *)message { Checks to see if any messages should be shown now */ - (void)evaluateMessages { + if (_isInAppMessagingPaused) { + [OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"Not evaluating in app messages while paused"]; + return; + } [OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"Evaluating in app messages"]; for (OSInAppMessageInternal *message in self.messages) { if ([self.triggerController messageMatchesTriggers:message]) {