Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ - (void)messageClicked:(FIRInAppMessagingDisplayMessage *)inAppMessage
[self recordValidImpression:_currentMsgBeingDisplayed.renderData.messageID
withMessageName:_currentMsgBeingDisplayed.renderData.name];

[self.analyticsEventLogger
logAnalyticsEventForType:FIRIAMAnalyticsEventActionURLFollow
forCampaignID:_currentMsgBeingDisplayed.renderData.messageID
withCampaignName:_currentMsgBeingDisplayed.renderData.name
eventTimeInMs:nil
completion:^(BOOL success) {
FIRLogDebug(kFIRLoggerInAppMessaging, @"I-IAM400032",
@"Logging analytics event for url following %@",
success ? @"succeeded" : @"failed");
}];
if (action.actionURL) {
[self.analyticsEventLogger
logAnalyticsEventForType:FIRIAMAnalyticsEventActionURLFollow
forCampaignID:_currentMsgBeingDisplayed.renderData.messageID
withCampaignName:_currentMsgBeingDisplayed.renderData.name
eventTimeInMs:nil
completion:^(BOOL success) {
FIRLogDebug(kFIRLoggerInAppMessaging, @"I-IAM400032",
@"Logging analytics event for url following %@",
success ? @"succeeded" : @"failed");
}];
}
}

NSURL *actionURL = action.actionURL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,12 @@ - (void)testAnalyticsTrackingOnMessageClickCase {

[self.clientMessageCache setMessageData:@[ self.m2 ]];

FIRInAppMessagingAction *m2Action = [[FIRInAppMessagingAction alloc]
initWithActionText:self.m2.renderData.contentData.actionButtonText
actionURL:self.m2.renderData.contentData.actionURL];
FIRIAMMessageDisplayForTesting *display = [[FIRIAMMessageDisplayForTesting alloc]
initWithDelegateInteraction:FIRInAppMessagingDelegateInteractionClick];
initWithDelegateInteraction:FIRInAppMessagingDelegateInteractionClick
action:m2Action];
self.displayExecutor.messageDisplayComponent = display;

[self.displayExecutor checkAndDisplayNextAppForegroundMessage];
Expand Down