-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically collected lifecycle events not SwiftUI friendly #1035
Comments
Hi @loganblevins I have app with SwiftUI any suggestion how to fix that |
Platform: iOS : SwiftUI I configured everything as per SDK documents But Any special things need to configure for this for SwiftUI to work on this event. |
I would also comment that this is more than just an minor documentation issue, since it is very likely that the app will be doing things during |
Also facing the same issue we have pure SwiftUI App everything configured according to documentation bot no automatic events are being tracked. |
Platform:
iOS + tvOS
Problem:
Segment auto tracked lifecycles events do not function with the SwiftUI lifecycle. Segment initialization requires
UIApplication
be valid to set up notification observers of global events such as:UIApplicationWillEnterForegroundNotification
.UIApplication
instance is not available oninit
of SwiftUI lifecycle@main
. To workaround this, the app delegate adaptor for UIKit lifecycle hooks must be implemented and Segment must be initialized inapplicationDidFinishLaunching
.This is not documented by Segment and can easily go unnoticed until it is realized that the auto tracked lifecycle events are not being fired.
My suggestion is that Segment not require
UIApplication
to be valid for setting up notification observers of global events for auto tracked lifecycle events.The text was updated successfully, but these errors were encountered: