diff --git a/src/NearbyInteraction/NICompat.cs b/src/NearbyInteraction/NICompat.cs new file mode 100644 index 000000000000..fc7dfaa4ebc8 --- /dev/null +++ b/src/NearbyInteraction/NICompat.cs @@ -0,0 +1,47 @@ +// +// NICompat.cs +// +// Copyright (C) Microsoft Corporation. All rights reserved. +// + +using System; +using System.ComponentModel; +using System.Threading.Tasks; +using Foundation; +using CoreFoundation; +using ObjCRuntime; + +#if __MACCATALYST__ || !IOS +using ARSession = Foundation.NSObject; +#else +using ARKit; +#endif + +#if NET +using Vector3 = global::System.Numerics.Vector3; +using MatrixFloat4x4 = global::CoreGraphics.NMatrix4; +#else +using NativeHandle = System.IntPtr; +using Vector3 = global::OpenTK.Vector3; +using MatrixFloat4x4 = global::OpenTK.NMatrix4; +#endif + +#nullable enable +namespace NearbyInteraction { + +#if WATCH + public partial class NISession { + +#if !NET + [Obsolete ("This method was removed and will always throw a InvalidOperationException.")] +#endif + public virtual void SetARSession (ARSession session) => throw new InvalidOperationException (Constants.ApiRemovedGeneral); + +#if !NET + [Obsolete ("This method was removed and will always throw a InvalidOperationException.")] +#endif + public virtual MatrixFloat4x4 GetWorldTransform (NINearbyObject @object) => throw new InvalidOperationException (Constants.ApiRemovedGeneral); + + } +#endif +} diff --git a/src/frameworks.sources b/src/frameworks.sources index ba4af2ac9308..fd81d2d20109 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1336,6 +1336,7 @@ NEARBYINTERACTION_API_SOURCES = \ NearbyInteraction/Enums.cs \ NEARBYINTERACTION_SOURCES = \ + NearbyInteraction/NICompat.cs \ NearbyInteraction/NINearbyObject.cs \ NearbyInteraction/NIAlgorithmConvergenceStatusReasonValues.cs \ diff --git a/src/nearbyinteraction.cs b/src/nearbyinteraction.cs index a1f34b83ed70..ba2300aad4b3 100644 --- a/src/nearbyinteraction.cs +++ b/src/nearbyinteraction.cs @@ -128,11 +128,11 @@ interface NISession [Export ("invalidate")] void Invalidate (); - [Watch (9,0), NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] [Export ("setARSession:")] void SetARSession (ARSession session); - [Watch (9,0), NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] + [NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)] [Export ("worldTransformForObject:")] [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] MatrixFloat4x4 GetWorldTransform (NINearbyObject @object);