xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.44k stars 507 forks source link

[arkit] 'ARConfiguration.IsSupported' vs 'ARWorldTrackingConfiguration.IsSupported' #5604

Open mykyta-bondarenko opened 5 years ago

mykyta-bondarenko commented 5 years ago

Steps to Reproduce

  1. Download the attached samples (xamarin + swift)
  2. Open AppDelegate.cs files
  3. Run both on a simulator

Expected Behavior

The output is the same for both

Actual Behavior

The output is different

Environment

  1. VSfM https://gist.github.com/mykyta-bondarenko-gl/fd511c06cb5307d1da41a95341ca9832

Build Logs

  1. Build Output https://gist.github.com/mykyta-bondarenko-gl/00a276b390c599a85a07a15dafd9a67a

Example Project

  1. Xamarin -
    https://github.com/xamarin/xamarin-macios/files/2860457/TestAR.zip
  2. Swift - https://github.com/xamarin/xamarin-macios/files/2860459/TestAR-Swift.zip
spouliot commented 5 years ago

Looks like it behave like SupportedVideoFormats (in PR#5348), i.e. in .NET both the static calls are, by default, identical.

spouliot commented 5 years ago

https://github.com/xamarin/xamarin-macios/pull/5348

dalexsoto commented 5 years ago

We have been hit by this many times, we really need to bring generator support for this... manual inlining is not optimal by any means :/

SerialForBreakfast commented 5 years ago

I just tested this with the iPhone 5S in the simulator and I can confirm that: ARConfiguration.isSupported returns true ARWorldTrackingConfiguration.isSupported returns false when they should both be false. The documentation states: "Important All ARKit configurations require an iOS device with an A9 or later processor." It appears that some devices(5S) have partial ARKit support and that could be what you are seeing here? https://github.com/SerialForBreakfast/ARKitARConfigTest

MarLoe commented 2 years ago

This is also the case for ARFaceTrackingConfiguration and all the other configurations that inherits from ARConfiguration (https://developer.apple.com/documentation/arkit/configuration_objects). Native they implement their own IsSupported but does not expose it in the interface, hence Xamarin fails to generate link to each configuration type.