diff --git a/src/Network/NWAdvertiseDescriptor.cs b/src/Network/NWAdvertiseDescriptor.cs index 2d1576fc8b..f8d6c11e6a 100644 --- a/src/Network/NWAdvertiseDescriptor.cs +++ b/src/Network/NWAdvertiseDescriptor.cs @@ -10,6 +10,7 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -19,8 +20,13 @@ using OS_nw_advertise_descriptor=System.IntPtr; using OS_nw_txt_record=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWAdvertiseDescriptor : NativeObject { public NWAdvertiseDescriptor (IntPtr handle, bool owns) : base (handle, owns) { } @@ -65,15 +71,33 @@ namespace Network { get => nw_advertise_descriptor_get_no_auto_rename (GetCheckedHandle ()); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern OS_nw_txt_record nw_advertise_descriptor_copy_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern void nw_advertise_descriptor_set_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor, OS_nw_txt_record txt_record); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public NWTxtRecord TxtRecord { get => new NWTxtRecord (nw_advertise_descriptor_copy_txt_record_object (GetCheckedHandle ()), owns: true); set => nw_advertise_descriptor_set_txt_record_object (GetCheckedHandle (), value.GetHandle ()); diff --git a/src/Network/NWBrowseResult.cs b/src/Network/NWBrowseResult.cs index 7e30975dc0..40b52455dd 100644 --- a/src/Network/NWBrowseResult.cs +++ b/src/Network/NWBrowseResult.cs @@ -11,6 +11,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,7 +22,13 @@ using OS_nw_txt_record=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWBrowseResult : NativeObject { internal NWBrowseResult (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWBrowser.cs b/src/Network/NWBrowser.cs index 179cff2062..cba746c62b 100644 --- a/src/Network/NWBrowser.cs +++ b/src/Network/NWBrowser.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -27,7 +28,13 @@ namespace Network { public delegate void NWBrowserCompleteChangesDelegate (List<(NWBrowseResult? result, NWBrowseResultChange change)>? changes); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWBrowser : NativeObject { bool started = false; diff --git a/src/Network/NWBrowserDescriptor.cs b/src/Network/NWBrowserDescriptor.cs index b82d930414..418b8f2ca4 100644 --- a/src/Network/NWBrowserDescriptor.cs +++ b/src/Network/NWBrowserDescriptor.cs @@ -11,6 +11,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -19,7 +20,13 @@ using OS_nw_browse_descriptor=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWBrowserDescriptor: NativeObject { internal NWBrowserDescriptor (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWConnection.cs b/src/Network/NWConnection.cs index ae75abdb65..d289f84b46 100644 --- a/src/Network/NWConnection.cs +++ b/src/Network/NWConnection.cs @@ -10,6 +10,7 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -41,8 +42,13 @@ namespace Network { // public delegate void NWConnectionReceiveReadOnlySpanCompletion (ReadOnlySpan data, NWContentContext? context, bool isComplete, NWError? error); +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWConnection : NativeObject { public NWConnection (IntPtr handle, bool owns) : base (handle, owns) {} @@ -564,7 +570,13 @@ namespace Network { BlockLiteral.SimpleCall (method, (arg)=> nw_connection_batch (GetCheckedHandle (), arg)); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] unsafe static extern void nw_connection_access_establishment_report (IntPtr connection, IntPtr queue, ref BlockLiteral access_block); @@ -582,7 +594,13 @@ namespace Network { } } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [BindingImpl (BindingImplOptions.Optimizable)] public void GetEstablishmentReport (DispatchQueue queue, Action handler) { diff --git a/src/Network/NWConnectionGroup.cs b/src/Network/NWConnectionGroup.cs index 757c04414b..1a5348f2d3 100644 --- a/src/Network/NWConnectionGroup.cs +++ b/src/Network/NWConnectionGroup.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -15,16 +16,27 @@ using OS_nw_endpoint=System.IntPtr; namespace Network { +#if !NET [TV (14,0), Mac (11,0), iOS (14,0), Watch (7,0)] [MacCatalyst (14,0)] +#endif public delegate void NWConnectionGroupReceiveDelegate (DispatchData content, NWContentContext context, bool isCompleted); +#if !NET [TV (14,0), Mac (11,0), iOS (14,0), Watch (7,0)] [MacCatalyst (14,0)] +#endif public delegate void NWConnectionGroupStateChangedDelegate (NWConnectionGroupState state, NWError? error); +#if !NET [TV (14,0), Mac (11,0), iOS (14,0), Watch (7,0)] [MacCatalyst (14,0)] +#else + [SupportedOSPlatform ("ios14.0")] + [SupportedOSPlatform ("tvos14.0")] + [SupportedOSPlatform ("macos11.0")] + [SupportedOSPlatform ("maccatalyst14.0")] +#endif public class NWConnectionGroup : NativeObject { protected NWConnectionGroup (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWContentContext.cs b/src/Network/NWContentContext.cs index 2a345a05e5..3a61689a1b 100644 --- a/src/Network/NWContentContext.cs +++ b/src/Network/NWContentContext.cs @@ -11,6 +11,7 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,8 +22,13 @@ namespace Network { // The content context, there are a few pre-configured content contexts for sending // available as static properties on this class // +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWContentContext : NativeObject { bool global; public NWContentContext (IntPtr handle, bool owns) : base (handle, owns) diff --git a/src/Network/NWDataTransferReport.cs b/src/Network/NWDataTransferReport.cs index 17b6d62f2e..1996083356 100644 --- a/src/Network/NWDataTransferReport.cs +++ b/src/Network/NWDataTransferReport.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -22,7 +23,13 @@ using OS_nw_interface=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWDataTransferReport : NativeObject { internal NWDataTransferReport (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWEndpoint.cs b/src/Network/NWEndpoint.cs index cf9af71e34..e327c5ddbd 100644 --- a/src/Network/NWEndpoint.cs +++ b/src/Network/NWEndpoint.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,8 +21,14 @@ using OS_nw_endpoint=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] + +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWEndpoint : NativeObject { public NWEndpoint (IntPtr handle, bool owns) : base (handle, owns) {} @@ -107,11 +114,23 @@ namespace Network { public string? BonjourServiceDomain => Marshal.PtrToStringAnsi (nw_endpoint_get_bonjour_service_domain (GetCheckedHandle ())); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] static extern OS_nw_endpoint nw_endpoint_create_url (string url); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public static NWEndpoint? Create (string url) { if (url == null) @@ -122,11 +141,23 @@ namespace Network { return new NWEndpoint (handle, owns: true); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr nw_endpoint_get_url (OS_nw_endpoint endpoint); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public string? Url => Marshal.PtrToStringAnsi (nw_endpoint_get_url (GetCheckedHandle ())); } } diff --git a/src/Network/NWError.cs b/src/Network/NWError.cs index a4e79726d5..64dd65a0e7 100644 --- a/src/Network/NWError.cs +++ b/src/Network/NWError.cs @@ -12,13 +12,19 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWError : NativeObject { public NWError (IntPtr handle, bool owns) : base (handle, owns) { diff --git a/src/Network/NWEstablishmentReport.cs b/src/Network/NWEstablishmentReport.cs index 5ad8134411..77d6acff4f 100644 --- a/src/Network/NWEstablishmentReport.cs +++ b/src/Network/NWEstablishmentReport.cs @@ -13,6 +13,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -24,7 +25,13 @@ using nw_protocol_definition_t=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWEstablishmentReport : NativeObject { internal NWEstablishmentReport (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWEthernetChannel.cs b/src/Network/NWEthernetChannel.cs index 790617c020..61b420bb50 100644 --- a/src/Network/NWEthernetChannel.cs +++ b/src/Network/NWEthernetChannel.cs @@ -14,6 +14,7 @@ using System; using System.Text; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -24,10 +25,16 @@ using OS_dispatch_data=System.IntPtr; namespace Network { +#if !NET [NoWatch, NoTV, NoiOS, Mac (10,15)] +#endif public delegate void NWEthernetChannelReceiveDelegate (DispatchData? content, ushort vlanTag, string? localAddress, string? remoteAddress); +#if !NET [NoWatch, NoTV, NoiOS, Mac (10,15)] +#else + [SupportedOSPlatform ("macos10.15")] +#endif public class NWEthernetChannel : NativeObject { internal NWEthernetChannel (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWFramer.cs b/src/Network/NWFramer.cs index 67c4d9a910..aad5e96a41 100644 --- a/src/Network/NWFramer.cs +++ b/src/Network/NWFramer.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -29,7 +30,13 @@ namespace Network { public delegate nuint NWFramerParseCompletionDelegate (Memory buffer, [MarshalAs (UnmanagedType.I1)] bool isCompleted); public delegate nuint NWFramerInputDelegate (NWFramer framer); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWFramer : NativeObject { internal NWFramer (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWFramerMessage.cs b/src/Network/NWFramerMessage.cs index 12d7ef2d95..754df1c3bd 100644 --- a/src/Network/NWFramerMessage.cs +++ b/src/Network/NWFramerMessage.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -26,7 +27,13 @@ using OS_nw_parameters=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWFramerMessage : NWProtocolMetadata { internal NWFramerMessage (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWIPMetadata.cs b/src/Network/NWIPMetadata.cs index aa9c6e7f64..f18ec9dd15 100644 --- a/src/Network/NWIPMetadata.cs +++ b/src/Network/NWIPMetadata.cs @@ -13,10 +13,16 @@ using System; using ObjCRuntime; using Foundation; using CoreFoundation; +using System.Runtime.Versioning; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWIPMetadata : NWProtocolMetadata { internal NWIPMetadata (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWInterface.cs b/src/Network/NWInterface.cs index a6cac8d872..5ef5a89864 100644 --- a/src/Network/NWInterface.cs +++ b/src/Network/NWInterface.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,8 +21,13 @@ using OS_nw_interface=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWInterface : NativeObject { public NWInterface (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWListener.cs b/src/Network/NWListener.cs index f4a7e559d6..abd0b52ab1 100644 --- a/src/Network/NWListener.cs +++ b/src/Network/NWListener.cs @@ -11,14 +11,20 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWListener : NativeObject { bool connectionHandlerWasSet = false; object connectionHandlerLock = new object (); @@ -234,15 +240,33 @@ namespace Network { nw_listener_set_advertise_descriptor (GetCheckedHandle (), descriptor.GetHandle ()); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern uint nw_listener_get_new_connection_limit (IntPtr listener); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern void nw_listener_set_new_connection_limit (IntPtr listener, uint new_connection_limit); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public uint ConnectionLimit { get => nw_listener_get_new_connection_limit (GetCheckedHandle ()); set => nw_listener_set_new_connection_limit (GetCheckedHandle (), value); diff --git a/src/Network/NWMulticastGroup.cs b/src/Network/NWMulticastGroup.cs index 6f9afddf7c..b6905658b8 100644 --- a/src/Network/NWMulticastGroup.cs +++ b/src/Network/NWMulticastGroup.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -10,8 +11,15 @@ using OS_nw_endpoint=System.IntPtr; namespace Network { +#if !NET [TV (14,0), Mac (11,0), iOS (14,0), Watch (7,0)] [MacCatalyst (14,0)] +#else + [SupportedOSPlatform ("ios14.0")] + [SupportedOSPlatform ("tvos14.0")] + [SupportedOSPlatform ("macos11.0")] + [SupportedOSPlatform ("maccatalyst14.0")] +#endif public class NWMulticastGroup : NativeObject { internal NWMulticastGroup (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index 5bf9037656..dbddddb596 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,8 +21,13 @@ using nw_parameters_t=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWParameters : NativeObject { public NWParameters (IntPtr handle, bool owns) : base (handle, owns) {} @@ -176,11 +182,19 @@ namespace Network { } #if MONOMAC +#if !NET [NoWatch, NoTV, NoiOS, Mac (10,15)] +#else + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] unsafe static extern IntPtr nw_parameters_create_custom_ip (byte custom_ip_protocol_number, BlockLiteral *configure_ip); +#if !NET [NoWatch, NoTV, NoiOS, Mac (10,15)] +#else + [SupportedOSPlatform ("macos10.15")] +#endif [BindingImpl (BindingImplOptions.Optimizable)] public unsafe static NWParameters CreateCustomIP (byte protocolNumber, Action? configureCustomIP = null) { @@ -476,16 +490,34 @@ namespace Network { set => nw_parameters_set_include_peer_to_peer (GetCheckedHandle (), value); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] static extern bool nw_parameters_get_prohibit_constrained (IntPtr parameters); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern void nw_parameters_set_prohibit_constrained (IntPtr parameters, [MarshalAs (UnmanagedType.I1)] bool prohibit_constrained); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public bool ProhibitConstrained { get => nw_parameters_get_prohibit_constrained (GetCheckedHandle ()); set => nw_parameters_set_prohibit_constrained (GetCheckedHandle (), value); diff --git a/src/Network/NWPath.cs b/src/Network/NWPath.cs index 1021784f16..3ae5f200c2 100644 --- a/src/Network/NWPath.cs +++ b/src/Network/NWPath.cs @@ -12,14 +12,20 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWPath : NativeObject { public NWPath (IntPtr handle, bool owns) : base (handle, owns) {} @@ -124,15 +130,33 @@ namespace Network { } } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] static extern bool nw_path_is_constrained (IntPtr path); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public bool IsConstrained => nw_path_is_constrained (GetCheckedHandle ()); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern void nw_path_enumerate_gateways (IntPtr path, ref BlockLiteral enumerate_block); @@ -149,7 +173,13 @@ namespace Network { } } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [BindingImpl (BindingImplOptions.Optimizable)] public void EnumerateGateways (Action callback) { @@ -166,13 +196,27 @@ namespace Network { } } +#if !NET [iOS (14,2)][TV (14,2)][Watch (7,1)][Mac (11,0)] [MacCatalyst (14,2)] +#else + [SupportedOSPlatform ("ios14.2")] + [SupportedOSPlatform ("tvos14.2")] + [SupportedOSPlatform ("macos11.0")] + [SupportedOSPlatform ("maccatalyst14.2")] +#endif [DllImport (Constants.NetworkLibrary)] static extern NWPathUnsatisfiedReason /* nw_path_unsatisfied_reason_t */ nw_path_get_unsatisfied_reason (IntPtr /* OS_nw_path */ path); +#if !NET [iOS (14,2)][TV (14,2)][Watch (7,1)][Mac (11,0)] [MacCatalyst (14,2)] +#else + [SupportedOSPlatform ("ios14.2")] + [SupportedOSPlatform ("tvos14.2")] + [SupportedOSPlatform ("macos11.0")] + [SupportedOSPlatform ("maccatalyst14.2")] +#endif public NWPathUnsatisfiedReason GetUnsatisfiedReason () { return nw_path_get_unsatisfied_reason (GetCheckedHandle ()); diff --git a/src/Network/NWPathMonitor.cs b/src/Network/NWPathMonitor.cs index b7a2e3686a..21edd3cc4d 100644 --- a/src/Network/NWPathMonitor.cs +++ b/src/Network/NWPathMonitor.cs @@ -12,14 +12,20 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWPathMonitor : NativeObject { public NWPathMonitor (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWProtocolDefinition.cs b/src/Network/NWProtocolDefinition.cs index acada3aedb..d9d0e8c75b 100644 --- a/src/Network/NWProtocolDefinition.cs +++ b/src/Network/NWProtocolDefinition.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,8 +21,13 @@ using OS_nw_protocol_definition=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolDefinition : NativeObject { public NWProtocolDefinition (IntPtr handle, bool owns) : base (handle, owns) {} @@ -78,20 +84,44 @@ namespace Network { public static NWProtocolDefinition CreateTlsDefinition () => new NWProtocolDefinition (nw_protocol_copy_tls_definition (), owns: true); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern OS_nw_protocol_definition nw_protocol_copy_ws_definition (); #if !XAMCORE_4_0 +#if !NET [Obsolete ("Use 'CreateWebSocketDefinition' method instead.")] [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] + [Obsolete ("Use 'CreateWebSocketDefinition' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif public static NWProtocolDefinition WebSocketDefinition => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true); #endif +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public static NWProtocolDefinition CreateWebSocketDefinition () => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true); +#if !NET [TV (13,0), Mac (10,15)] +#else + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] static extern unsafe OS_nw_protocol_definition nw_framer_create_definition (string identifier, NWFramerCreateFlags flags, ref BlockLiteral start_handler); delegate NWFramerStartResult nw_framer_create_definition_t (IntPtr block, IntPtr framer); @@ -109,7 +139,13 @@ namespace Network { return NWFramerStartResult.Unknown; } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [BindingImpl (BindingImplOptions.Optimizable)] public static NWProtocolDefinition CreateFramerDefinition (string identifier, NWFramerCreateFlags flags, Func startCallback) { diff --git a/src/Network/NWProtocolIPOptions.cs b/src/Network/NWProtocolIPOptions.cs index f96eaa42b7..83d94ab730 100644 --- a/src/Network/NWProtocolIPOptions.cs +++ b/src/Network/NWProtocolIPOptions.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,7 +22,13 @@ using IntPtr=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWProtocolIPOptions : NWProtocolOptions { internal NWProtocolIPOptions (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWProtocolMetadata.cs b/src/Network/NWProtocolMetadata.cs index a5a5dbe31f..3c124e088b 100644 --- a/src/Network/NWProtocolMetadata.cs +++ b/src/Network/NWProtocolMetadata.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -22,8 +23,13 @@ using nw_service_class_t=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolMetadata : NativeObject { [DllImport (Constants.NetworkLibrary)] @@ -196,20 +202,44 @@ namespace Network { } #endif +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] internal static extern bool nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ()); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] [return: MarshalAs (UnmanagedType.I1)] internal static extern bool nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ()); } } diff --git a/src/Network/NWProtocolOptions.cs b/src/Network/NWProtocolOptions.cs index 04e89dd709..b85425456f 100644 --- a/src/Network/NWProtocolOptions.cs +++ b/src/Network/NWProtocolOptions.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,8 +22,13 @@ using IntPtr=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolOptions : NativeObject { public NWProtocolOptions (IntPtr handle, bool owns) : base (handle, owns) {} @@ -107,12 +113,26 @@ namespace Network { } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif [DllImport (Constants.NetworkLibrary)] internal static extern void nw_ip_options_set_local_address_preference (IntPtr options, NWIPLocalAddressPreference preference); +#if !NET [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] [TV (13,0), Mac (10,15), iOS (13,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] + [UnsupportedOSPlatform ("maccatalystq")] + [Obsolete ("Use the 'NWProtocolIPOptions' class instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif public NWIPLocalAddressPreference IPLocalAddressPreference { set => nw_ip_options_set_local_address_preference (GetCheckedHandle (), value); } diff --git a/src/Network/NWProtocolStack.cs b/src/Network/NWProtocolStack.cs index 0794c54556..2bef84f2d8 100644 --- a/src/Network/NWProtocolStack.cs +++ b/src/Network/NWProtocolStack.cs @@ -11,6 +11,7 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -23,8 +24,13 @@ using nw_protocol_options_t=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0)] [Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolStack : NativeObject { public NWProtocolStack (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWProtocolTcpOptions.cs b/src/Network/NWProtocolTcpOptions.cs index 0d86a558f2..c4940dcb72 100644 --- a/src/Network/NWProtocolTcpOptions.cs +++ b/src/Network/NWProtocolTcpOptions.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,7 +22,12 @@ using IntPtr=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolTcpOptions : NWProtocolOptions { internal NWProtocolTcpOptions (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWProtocolTlsOptions.cs b/src/Network/NWProtocolTlsOptions.cs index 2b8eafa81f..7d072a4422 100644 --- a/src/Network/NWProtocolTlsOptions.cs +++ b/src/Network/NWProtocolTlsOptions.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,7 +22,12 @@ using IntPtr=System.IntPtr; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolTlsOptions : NWProtocolOptions { internal NWProtocolTlsOptions (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWProtocolUdpOptions.cs b/src/Network/NWProtocolUdpOptions.cs index c97b7fce33..d906397320 100644 --- a/src/Network/NWProtocolUdpOptions.cs +++ b/src/Network/NWProtocolUdpOptions.cs @@ -14,10 +14,16 @@ using ObjCRuntime; using Foundation; using CoreFoundation; using Security; +using System.Runtime.Versioning; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWProtocolUdpOptions : NWProtocolOptions { internal NWProtocolUdpOptions (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWTcpMetadata.cs b/src/Network/NWTcpMetadata.cs index cab51a4463..370af2d712 100644 --- a/src/Network/NWTcpMetadata.cs +++ b/src/Network/NWTcpMetadata.cs @@ -13,10 +13,16 @@ using System; using ObjCRuntime; using Foundation; using CoreFoundation; +using System.Runtime.Versioning; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWTcpMetadata : NWProtocolMetadata { internal NWTcpMetadata (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWTlsMetadata.cs b/src/Network/NWTlsMetadata.cs index c105514130..12e7b6d72c 100644 --- a/src/Network/NWTlsMetadata.cs +++ b/src/Network/NWTlsMetadata.cs @@ -14,10 +14,16 @@ using ObjCRuntime; using Foundation; using Security; using CoreFoundation; +using System.Runtime.Versioning; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWTlsMetadata : NWProtocolMetadata { internal NWTlsMetadata (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWTxtRecord.cs b/src/Network/NWTxtRecord.cs index bd34520fd8..35092cf33c 100644 --- a/src/Network/NWTxtRecord.cs +++ b/src/Network/NWTxtRecord.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using System.Text; using ObjCRuntime; using Foundation; @@ -24,8 +25,13 @@ using OS_nw_txt_record=System.IntPtr; namespace Network { - +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWTxtRecord : NativeObject { internal NWTxtRecord (IntPtr handle, bool owns) : base (handle, owns) { } diff --git a/src/Network/NWUdpMetadata.cs b/src/Network/NWUdpMetadata.cs index 0ae110d887..6f17017f62 100644 --- a/src/Network/NWUdpMetadata.cs +++ b/src/Network/NWUdpMetadata.cs @@ -14,10 +14,16 @@ using ObjCRuntime; using Foundation; using Security; using CoreFoundation; +using System.Runtime.Versioning; namespace Network { +#if !NET [TV (12,0), Mac (10,14), iOS (12,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios12.0")] + [SupportedOSPlatform ("tvos12.0")] +#endif public class NWUdpMetadata : NWProtocolMetadata { internal NWUdpMetadata (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWWebSocketMetadata.cs b/src/Network/NWWebSocketMetadata.cs index 70698015e4..abe7258791 100644 --- a/src/Network/NWWebSocketMetadata.cs +++ b/src/Network/NWWebSocketMetadata.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -22,7 +23,13 @@ using dispatch_queue_t =System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWWebSocketMetadata : NWProtocolMetadata { internal NWWebSocketMetadata (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWWebSocketOptions.cs b/src/Network/NWWebSocketOptions.cs index 632e623f79..f3cb96b910 100644 --- a/src/Network/NWWebSocketOptions.cs +++ b/src/Network/NWWebSocketOptions.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -21,7 +22,13 @@ using nw_ws_request_t=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWWebSocketOptions : NWProtocolOptions { bool autoReplyPing = false; bool skipHandShake = false; diff --git a/src/Network/NWWebSocketRequest.cs b/src/Network/NWWebSocketRequest.cs index 79647cbd3d..43fdbc61ef 100644 --- a/src/Network/NWWebSocketRequest.cs +++ b/src/Network/NWWebSocketRequest.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,7 +21,13 @@ using OS_nw_ws_request=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWWebSocketRequest : NativeObject { internal NWWebSocketRequest (IntPtr handle, bool owns) : base (handle, owns) {} diff --git a/src/Network/NWWebSocketResponse.cs b/src/Network/NWWebSocketResponse.cs index 1304af0ff3..923ddd5fad 100644 --- a/src/Network/NWWebSocketResponse.cs +++ b/src/Network/NWWebSocketResponse.cs @@ -12,6 +12,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using ObjCRuntime; using Foundation; using CoreFoundation; @@ -20,7 +21,13 @@ using OS_nw_ws_response=System.IntPtr; namespace Network { +#if !NET [TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)] +#else + [SupportedOSPlatform ("ios13.0")] + [SupportedOSPlatform ("tvos13.0")] + [SupportedOSPlatform ("macos10.15")] +#endif public class NWWebSocketResponse : NativeObject { internal NWWebSocketResponse (IntPtr handle, bool owns) : base (handle, owns) {}