diff --git a/CHANGELOG.md b/CHANGELOG.md index b563c7b8..7de7e5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## xx.xx.xx +* Mitigated an issue with experimental visibility tracking and previous name recording, ensuring they’re included even when no segmentation is provided in event or view recording. + ## 24.7.5 * Mitigated an issue with content action json parsing due to json encoding * Mitigated an issue where pausing a view resulted in a '0' view duration. diff --git a/Countly.m b/Countly.m index 3b61f6e6..7cf1d60f 100644 --- a/Countly.m +++ b/Countly.m @@ -905,6 +905,8 @@ - (void)recordEvent:(NSString *)key segmentation:(NSDictionary *)segmentation co BOOL isReservedEvent = [self isReservedEvent:key]; NSMutableDictionary *filteredSegmentations = segmentation.cly_filterSupportedDataTypes; + if(filteredSegmentations == nil) + filteredSegmentations = NSMutableDictionary.new; // If the event is not reserved, assign the previous event ID and Name to the current event's PEID property, or an empty string if previousEventID is nil. Then, update previousEventID to the current event's ID. if (!isReservedEvent) @@ -941,7 +943,8 @@ - (NSDictionary*) processSegmentation:(NSMutableDictionary *) segmentation event if(CountlyCommon.sharedInstance.enableVisibiltyTracking) { segmentation[kCountlyVisibility] = @([self isAppInForeground]); } - return segmentation; + + return segmentation.count == 0 ? nil : segmentation; } - (BOOL)isAppInForeground {