You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a view controller contains multiple embedded child view controllers, UIKitScreenViews should not return the first child; instead, it should return nil. In cases where there is only one child, it should return that single child view controller as it is done currently.
Why this should be the correct Behavior?
If a view controller has two or more child view controllers, they should not be considered the correct screen name. Instead, they should be treated as "subviews" within a "parent view". In this case, the parent view controller that contains the child controllers should be considered the correct source for the screen name.
Current Behavior
Context: Screen view tracking can be enabled by including AutocaptureOptions.screenViews in the autocapture configuration from Amplitude. When you enable this setting, Amplitude tracks the [Amplitude] Screen Viewed event and sets the screen name property of this event to the name of the top-most view controller's class using the UIKitScreenViews class.
Problem: Issue with Embedded Child View Controllers
We found multiple cases where a view controller contains two or more embedded child view controllers.
Amplitude’s automatic tracking does not handle these situations correctly. It tracks only the first embedded child view controller, resulting in incorrect screen name tracking.
Possible Solution
UIKitScreenViews.swift, around line 112, in the amp_topViewController method.
Current validation:
Expected Behavior
When a view controller contains multiple embedded child view controllers, UIKitScreenViews should not return the first child; instead, it should return nil. In cases where there is only one child, it should return that single child view controller as it is done currently.
Why this should be the correct Behavior?
If a view controller has two or more child view controllers, they should not be considered the correct screen name. Instead, they should be treated as "subviews" within a "parent view". In this case, the parent view controller that contains the child controllers should be considered the correct source for the screen name.
Current Behavior
Context: Screen view tracking can be enabled by including AutocaptureOptions.screenViews in the autocapture configuration from Amplitude. When you enable this setting, Amplitude tracks the [Amplitude] Screen Viewed event and sets the screen name property of this event to the name of the top-most view controller's class using the UIKitScreenViews class.
Problem: Issue with Embedded Child View Controllers
We found multiple cases where a view controller contains two or more embedded child view controllers.
Amplitude’s automatic tracking does not handle these situations correctly. It tracks only the first embedded child view controller, resulting in incorrect screen name tracking.
Possible Solution
UIKitScreenViews.swift, around line 112, in the amp_topViewController method.
Current validation:
Fixed validation:
Steps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: