-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[NT-1851] Enable/Disable Segment By Feature Flag #1440
Conversation
} | ||
} | ||
|
||
NotificationCenter.default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ordinarily we would hang on to the token for these observers and release them but the AppDelegate
is never released so I guess it's ok here 😄
|
||
extension Analytics: IdentifyingTrackingClient { | ||
public func identify(userId: String?, traits: [String: Any]?) { | ||
guard AppEnvironment.current.environmentVariables.isTrackingEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weirdly no tests failed removing this so it looks like we weren't testing it anyway 🤦♂️
Codecov Report
@@ Coverage Diff @@
## master #1440 +/- ##
==========================================
- Coverage 86.09% 86.09% -0.01%
==========================================
Files 1108 1107 -1
Lines 98602 98646 +44
==========================================
+ Hits 84895 84932 +37
- Misses 13707 13714 +7
Continue to review full report at Codecov.
|
Configs/Secrets.swift.example
Outdated
public static let staging = "write-key" | ||
public static let production = "write-key" | ||
public static let staging = "write-key-production" | ||
public static let production = "write-key-staging" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you mixed these up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh lol yeah, they mostly just need to not be the same but best have them the right way around 👍
Kickstarter-iOS/AppDelegate.swift
Outdated
|
||
self.viewModel.outputs.segmentIsEnabled | ||
.observeValues { enabled in | ||
if enabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would a ternary operator work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see why not! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
📲 What
AppEnvironment
is set up.🤔 Why
Analytics
during the instantiation of theAppEnvironment
and therefore could not inspect the environment at the same time. Moving this makes more tests possible.track
,identify
, etc methods but Segment would still track app lifecycle events. It turns out Segment providesdisable()
andenable()
functions to completely disable/enable tracking which we are now using instead.🛠 How
AppDelegateViewModel
output.✅ Acceptance criteria
Open Segment's debugger and run the app.