Closed xxZap closed 11 months ago
Some features require to be run in the main thread, but we should not crash anyway but rather do not install the features, so it's a bug. I'd recommend using the main thread for now.
https://github.com/PostHog/posthog-ios/releases/tag/3.0.0-alpha.2 should have fixed this issue, just tested it by initing the new SDK as:
private let dispatchQueue = DispatchQueue(label: "com.posthog.test", target: .global(qos: .utility))
dispatchQueue.async {
// init iOS SDK v3
}
With the latest
2.0.3
version it seems like when you call the method to initialize the library if this is not called on the main thread, the console is filling with tons of errors.As the title suggests, the method that is causing these errors is
PHGPostHog.setup(with: configuration)
It seems like the setup method is now calling some UIApplication's method.
Since this behaviour is not indicated anywhere nor in the internal or external documentation, I'm actually using this API on a parallel Thread and this is causing the errors.
Is this side effect to be considered a new requirement to use your library, or is it actually a bug?
Otherwise, I have to rethink all the way I'm initiating the PostHog component