-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: support multiple PostHog instances part II #309
feat: support multiple PostHog instances part II #309
Conversation
…e per key" This reverts commit 971a86e. # Conflicts: # PostHog.xcodeproj/project.pbxproj # PostHog/PostHogSDK.swift # PostHogTests/PostHogSDKInstanceTest.swift # PostHogTests/TestUtils/TestPostHog.swift
// needs to happen on next runloop cause we are still in SDK init sequence here | ||
DispatchQueue.main.async { | ||
self.captureAppInstallOrUpdated() | ||
} |
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.
I think to avoid this we can do this:
https://github.com/PostHog/posthog-android/blob/41ac8e9dbf989348823052c8c0f14c9c0d1fa2fd/posthog/src/main/java/com/posthog/PostHog.kt#L125-L131
we create the instances, and "install" them once the SDK is operational at the end of the setup method
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.
Refactored to add PostHogIntegration
. To be used only internally but should help as we continue adding integrations
@ioannisj for |
same for |
…tances-part-2 # Conflicts: # PostHog.xcodeproj/project.pbxproj # PostHog/Autocapture/PostHogAutocaptureIntegration.swift # PostHog/PostHogSDK.swift # PostHog/Replay/PostHogReplayIntegration.swift # PostHogTests/PostHogIntegrationInstallationTest.swift
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.
left a question otherwise LGTM
💡 Motivation and Context
Second part of supporting multiple instances
Todo:
captureApplicationLifecycleEvents
(autocapture) only on first created instancecaptureScreenViews
only on first created instancepostHogScreenView
from PostHogSDK.shared#skip-changelog
💚 How did you test it?
📝 Checklist