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

Fix visionOS support #1565

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

msmollin
Copy link

Goal

This fixes a build error when targeting visionOS (xrOS) devices in Xcode 15 beta 2
Screenshot 2023-06-21 at 11 05 13 PM

Design

Per the docs listed here:

https://developer.apple.com/documentation/visionos/bringing-your-app-to-visionos#Isolate-features-that-are-unavailable-in-visionOS

When separating code for visionOS and iOS, understand that conditional checks for iOS also return true in visionOS, so place visionOS conditions first and execute the iOS code only if visionOS isn’t present.

Changeset

Added a !TARGET_OS_XR condition on the front per recommendations from Apple docs.

Testing

Imported my fork into my project and it built whereas it did not before.

@msmollin
Copy link
Author

msmollin commented Jun 22, 2023

This likely can't merge until Xcode 15 is generally available but figured I'd put this up to help folks trying out the betas.

See below comment from @marcpalmer and my subsequent update.

@marcpalmer
Copy link

marcpalmer commented Jun 23, 2023

I think this could land pre-Xcode 15 release with a check for the definition of the macro? Wouldn't something like this work:

#ifndef TARGET_OS_XR
  #define TARGET_OS_XR 0
#endif

If this does not ship until after Xcode 15 is GM nobody can use bugsnag in the interim without forking, and even after Xcode 15 is GM, many people will still be using Xcode 14 so we need a fix that works for any Xcode release?

@msmollin
Copy link
Author

@marcpalmer that's a good point. My objc is fairly rusty so thanks for the direction. Added that here.

@johnkiely1
Copy link
Member

HI @msmollin @marcpalmer , Thanks for this PR, adding official support for VisionOS is definitely something we are interested in doing, however do need to do some additional work to fully understand the scope of changes involved. Going to leave this open for now and we will revisit soon. Sounds like forking the repo is the most reasonable workaround for now.

@johnkiely1 johnkiely1 added the backlog We hope to fix this feature/bug in the future label Jul 4, 2023
@matthargett
Copy link

With Xcode 15.2 now officially (no longer a beta) released with visionOS support, should this be revisited? Sentry also has a PR up that adds visionOS support.

@clr182
Copy link

clr182 commented Jan 11, 2024

Hi @matthargett
Thank you for reaching out on this issue.
VisionOS is a platform we do aim to support at some time in the future. However, as for our previous message, we still do not have a clear ETA on a release.
Once we have more information to share, we will be sure to update this thread!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants