bugsnag-cocoa icon indicating copy to clipboard operation
bugsnag-cocoa copied to clipboard

Fix visionOS support

Open msmollin opened this issue 2 years ago • 6 comments

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 avatar Jun 22 '23 03:06 msmollin

~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.

msmollin avatar Jun 22 '23 03:06 msmollin

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 avatar Jun 23 '23 16:06 marcpalmer

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

msmollin avatar Jun 24 '23 03:06 msmollin

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 avatar Jul 04 '23 10:07 johnkiely1

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.

matthargett avatar Jan 10 '24 20:01 matthargett

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!

clr182 avatar Jan 11 '24 14:01 clr182