Disable the default analytics configurations for forks. (#5688)

* Disable the default analytics configurations for forks.

* Check the analytics configuration instead of the PostHog Config.
This commit is contained in:
Doug
2022-02-24 15:46:18 +00:00
committed by GitHub
parent 02693de1d0
commit 69f9a92a47
5 changed files with 37 additions and 20 deletions
@@ -18,11 +18,12 @@ import PostHog
extension PHGPostHogConfiguration {
static var standard: PHGPostHogConfiguration? {
guard let apiKey = BuildSettings.analyticsKey, let host = BuildSettings.analyticsHost else { return nil }
let analyticsConfiguration = BuildSettings.analyticsConfiguration
guard analyticsConfiguration.isEnabled else { return nil }
let configuration = PHGPostHogConfiguration(apiKey: apiKey, host: host)
configuration.shouldSendDeviceID = false
let postHogConfiguration = PHGPostHogConfiguration(apiKey: analyticsConfiguration.apiKey, host: analyticsConfiguration.host)
postHogConfiguration.shouldSendDeviceID = false
return configuration
return postHogConfiguration
}
}