bugsnag-cocoa
bugsnag-cocoa copied to clipboard
Fix visionOS support
Goal
This fixes a build error when targeting visionOS (xrOS) devices in Xcode 15 beta 2
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.
~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.
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?
@marcpalmer that's a good point. My objc is fairly rusty so thanks for the direction. Added that here.
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.
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.
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!