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
if !bundle.bundlePath.hasPrefix(Bundle.main.bundlePath){
return
}
where
(lldb) po bundle.bundlePath
"/System/Library/PrivateFrameworks/UIKitCore.framework"
(lldb) po Bundle.main.bundlePath
"/private/var/containers/Bundle/Application/4AC5FC00-2EE0-446D-AB8F-190B8B030758/myapp.app"
For context which might be related: my UIViewControllers are in a separate framework, not in the main bundle, but either way it must not interfere with tracking.
If I understand correctly, and as lldb printing above suggests - tracking can't happen because in my caseBundle.main.bundlePath obviously can't be a prefix for bundle.bundlePath.
Possible Solution
Revise bundle checks. I wonder what could have been the reason to put this check in the first place?
Steps to Reproduce
Create a ViewController, potentially in a framework (referenced by main app target).
Check if screen events are being tracked.
Environment
SDK Version: Amplitude-Swift 1.1.0
iOS version: 15.7.3
Xcode: 15.1
OS Info: MacOS 14.3.1 (23D60)
The text was updated successfully, but these errors were encountered:
UPD:
I retested on my specific view controller, not Apple-provided, and there are updated bundle paths:
(lldb) po Bundle.main.bundlePath
"/private/var/containers/Bundle/Application/1610E596-5999-4C6B-AE2E-12868E894729/myapp.app"
(lldb) po bundle.bundlePath
"/var/containers/Bundle/Application/1610E596-5999-4C6B-AE2E-12868E894729/myapp.app/Frameworks/myappCore.framework"
So the issue still seems to be bad check on bundle caused by "/private" prefix in main bundle path
Expected Behavior
Using
defaultTracking.screenViews = true
orDefaultTrackingOptions.ALL
on Amplitude initialisation should enable automatic screen trackingCurrent Behavior
Screen events don't track automatically.
Debugging shows that
UIViewController.viewDidAppear
swizzled successfully, but tracking fails on bundle check:Amplitude-Swift/Sources/Amplitude/Plugins/iOS/UIKitScreenViews.swift
Lines 55 to 58 in 0b77c2e
where
For context which might be related: my UIViewControllers are in a separate framework, not in the main bundle, but either way it must not interfere with tracking.
If I understand correctly, and as lldb printing above suggests - tracking can't happen because in my case
Bundle.main.bundlePath
obviously can't be a prefix forbundle.bundlePath
.Possible Solution
Revise bundle checks. I wonder what could have been the reason to put this check in the first place?
Steps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: