Skip to content

Commit

Permalink
Don't evaluate in app messages when paused
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
nan-li committed Nov 25, 2024
1 parent d1a45fd commit 9d099bc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit 9d099bc

Please sign in to comment.