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

[NearbyInteraction] Remove NISession.SetARSession from Mac Catalyst. #17300

Merged
merged 2 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions src/NearbyInteraction/NICompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Copyright (C) Microsoft Corporation. All rights reserved.
//

#if !XAMCORE_5_0

using System;
using System.ComponentModel;
using System.Threading.Tasks;
Expand All @@ -29,19 +31,26 @@
#nullable enable
namespace NearbyInteraction {

#if WATCH
#if !__MACOS__ && !__TVOS__
public partial class NISession {

#if !NET
#if WATCH
[Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
#endif
[EditorBrowsable (EditorBrowsableState.Never)]
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
[EditorBrowsable (EditorBrowsableState.Never)]
public virtual MatrixFloat4x4 GetWorldTransform (NINearbyObject @object) => throw new InvalidOperationException (Constants.ApiRemovedGeneral);
#endif // WATCH

}
#if __MACCATALYST__
[Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
[EditorBrowsable (EditorBrowsableState.Never)]
public virtual void SetARSession (NSObject session) => throw new InvalidOperationException (Constants.ApiRemovedGeneral);
#endif
}
#endif // !__MACOS__ && !__TVOS__
}

#endif // !XAMCORE_5_0
3 changes: 2 additions & 1 deletion src/nearbyinteraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ interface NISession {
[Export ("invalidate")]
void Invalidate ();

[NoWatch, NoTV, NoMac, iOS (16, 0), MacCatalyst (16, 0)]
[NoMacCatalyst] // We don't have ARKit bindings for Mac Catalyst (because ARKit doesn't work on Mac Catalyst), so we can't bind this method.
[NoWatch, NoTV, NoMac, iOS (16, 0)]
[Export ("setARSession:")]
void SetARSession (ARSession session);

Expand Down