PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
32 stars 41 forks source link

Support for macOS #24

Closed txbrown closed 10 months ago

txbrown commented 2 years ago

Can't install on a macOS target in a multi-paltform app (iOS+macOS).

jeff-h commented 2 years ago

Same issue for me — this won't compile for a Mac-only app. There are imports for UIKit in six classes which precludes compiling this for macOS.

#import <UIKit/UIKit.h>

jeff-h commented 2 years ago

I noticed in the PostHog docs that "you can use any of our libraries or any Mixpanel library". So I went with the Mixpanel SPM package and it seems to be sending events through just fine from my Mac app to PostHog :)

marandaneto commented 10 months ago

Similar to https://github.com/PostHog/posthog-ios/issues/51

wasauce commented 10 months ago

@marandaneto - will the new iOS sdk bring support to macOS? And or do you have a rough timeframe for when that could happen? I also see fromthe poster above -- that they used the Mixpanel SPM package -- does that method still work?

marandaneto commented 10 months ago

@wasauce the v3 SDK has compiler flags so it should just work on macOS, but a few features that depend on UIKit etc won't work but that's fine if you don't need them. The first v3 alpha is out today. Not sure if Mixpanel SDK is still compatible, that comment was 1y+ ago and the docs have been updated.

marandaneto commented 10 months ago

Similar to https://github.com/PostHog/posthog-ios/issues/24 Some features don't work because they depend on UIKit or something available only for iOS targets, but the SDK should do the basic stuff as sending events, etc. https://github.com/PostHog/posthog-ios/releases/tag/3.0.0-alpha.2