snowplow / snowplow-ios-tracker

Snowplow event tracker for Swift and Objective-C. Add analytics to your iOS, macOS, tvOS and watchOS apps and games
http://snowplow.io
Apache License 2.0
81 stars 93 forks source link

Fix bundle path check to handle symbolic links (close #858) #859

Closed mylifeasdog closed 10 months ago

mylifeasdog commented 10 months ago

This PR addresses issue #858 concerning the Snowplow SDK's bundle path handling in modularized iOS apps. The current UIViewController extension's method for tracking screen views fails on real iOS devices due to not accounting for the symbolic link between /private/var/ and /var/.

The fix involves updating sp_viewDidAppear to use resolvingSymlinksInPath(), ensuring the bundle paths for both the main app and its frameworks are standardized. This method resolves /private/var/ to /var/, aligning framework paths with the main app bundle. This change guarantees accurate tracking of view controllers across all frameworks on iOS devices.

mylifeasdog commented 9 months ago

LGTM! It works nicely, thank you for the contribution @mylifeasdog! We will release it in the upcoming version 6.0.0 release of the tracker.

Could you inform me about the expected release window for version 6.0.0? This will help me decide whether to implement alternative solutions or wait for the official update, depending on the timeline.

Thank you!

matus-tomlein commented 9 months ago

Hi @mylifeasdog, the plan is to release it today!