Skip to content
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

Add visionOS support #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

harlanhaskins
Copy link

This switches to canImport(UIKit)/canImport(AppKit)/canImport(WatchKit) instead of OS-specific checks in the cases where the only requirement is importing the specific framework and using those symbols.

This also adds an entry into the device type matching for Apple Vision Pro and updates the demo project and tests to also run on visionOS.

💡 Motivation and Context

We're currently unable to use PostHog on visionOS because of compilation issues, and we would like to be able to.

💚 How did you test it?

Added build support to the Demo project for Apple Vision Pro and ran in the simulator. All tests continue to pass. Note: I had to update Nimble to the latest version for the test to be able to build successfully.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

This switches to `canImport(UIKit)`/`canImport(AppKit)`/`canImport(WatchKit)` instead
of OS-specific checks in the cases where the only requirement is importing the specific
framework and using those symbols.

This also adds an entry into the device type matching for Apple Vision Pro.
@marandaneto
Copy link
Member

@harlanhaskins thanks for the PR.

@ioannisj will let you review this.
One thing to pay attention to is when to import ios or uikit, session replay is ios only so we need to be sure we're not leaking any method, view modifier, etc for platforms that have uikit but not session replay yet, otherwise it seems legit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants